mirror of
https://gitee.com/shuto/cordova-plugin-file-opener2.git
synced 2025-03-15 22:21:01 +08:00
chore(): updated readme file with new android_support_version variable
This commit is contained in:
parent
054d7fa21b
commit
636bce54bc
37
README.md
37
README.md
@ -17,17 +17,18 @@ Requirements
|
||||
|
||||
Installation
|
||||
-------------
|
||||
cordova plugin add cordova-plugin-file-opener2
|
||||
|
||||
$ cordova plugin add cordova-plugin-file-opener2
|
||||
$ cordova plugin add cordova-plugin-file-opener2 --variable ANDROID_SUPPORT_VERSION={required version}
|
||||
|
||||
Usage
|
||||
------
|
||||
cordova.plugins.fileOpener2.open(
|
||||
filePath,
|
||||
fileMIMEType,
|
||||
filePath,
|
||||
fileMIMEType,
|
||||
{
|
||||
error : function(){ },
|
||||
success : function(){ }
|
||||
}
|
||||
error : function(){ },
|
||||
success : function(){ }
|
||||
}
|
||||
);
|
||||
|
||||
Examples
|
||||
@ -35,21 +36,21 @@ Examples
|
||||
Open an APK install dialog:
|
||||
|
||||
cordova.plugins.fileOpener2.open(
|
||||
'/sdcard/Download/gmail.apk',
|
||||
'/sdcard/Download/gmail.apk',
|
||||
'application/vnd.android.package-archive'
|
||||
);
|
||||
|
||||
|
||||
Open a PDF document with the default PDF reader and optional callback object:
|
||||
|
||||
cordova.plugins.fileOpener2.open(
|
||||
'/sdcard/Download/starwars.pdf', // You can also use a Cordova-style file uri: cdvfile://localhost/persistent/Download/starwars.pdf
|
||||
'application/pdf',
|
||||
{
|
||||
error : function(e) {
|
||||
'application/pdf',
|
||||
{
|
||||
error : function(e) {
|
||||
console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
|
||||
},
|
||||
success : function () {
|
||||
console.log('file opened successfully');
|
||||
console.log('file opened successfully');
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -58,13 +59,13 @@ Open a system modal to open PDF document with one of the already installed app a
|
||||
|
||||
cordova.plugins.fileOpener2.showOpenWithDialog(
|
||||
'/sdcard/Download/starwars.pdf', // You can also use a Cordova-style file uri: cdvfile://localhost/persistent/Download/starwars.pdf
|
||||
'application/pdf',
|
||||
{
|
||||
error : function(e) {
|
||||
'application/pdf',
|
||||
{
|
||||
error : function(e) {
|
||||
console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
|
||||
},
|
||||
success : function () {
|
||||
console.log('file opened successfully');
|
||||
console.log('file opened successfully');
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -102,7 +103,7 @@ Uninstall a package with its id.
|
||||
|
||||
cordova.plugins.fileOpener2.uninstall('com.zynga.FarmVille2CountryEscape', {
|
||||
error : function(e) {
|
||||
console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
|
||||
console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
|
||||
},
|
||||
success : function() {
|
||||
console.log('Uninstall intent activity started.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user