diff --git a/src/@ionic-native/plugins/file-opener/index.ts b/src/@ionic-native/plugins/file-opener/index.ts index 441f18439..afa247105 100644 --- a/src/@ionic-native/plugins/file-opener/index.ts +++ b/src/@ionic-native/plugins/file-opener/index.ts @@ -18,6 +18,10 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * .then(() => console.log('File is opened')) * .catch(e => console.log('Error opening file', e)); * + * this.fileOpener.showOpenWithDialog('path/to/file.pdf', 'application/pdf') + * .then(() => console.log('File is opened')) + * .catch(e => console.log('Error opening file', e)); + * * ``` */ @Plugin({ @@ -71,4 +75,19 @@ export class FileOpener extends IonicNativePlugin { appIsInstalled(packageId: string): Promise { return; } + + /** + * Opens with system modal to open file with an already installed app. + * @param {string} filePath File Path + * @param {string} fileMIMEType File MIME Type + * @returns {Promise} + */ + @Cordova({ + callbackStyle: 'object', + successName: 'success', + errorName: 'error' + }) + showOpenWithDialog(filePath: string, fileMIMEType: string): Promise { + return; + } }