feat(FileOpener): add showOpenWithDialog function #3014

feat(FileOpener): Added method showOpenWithDialog
This commit is contained in:
Daniel Sogl 2019-05-16 06:55:27 +02:00 committed by GitHub
commit 0dc320bbd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<any> {
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<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'error'
})
showOpenWithDialog(filePath: string, fileMIMEType: string): Promise<any> {
return;
}
}