pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 584 forks source link

the file does not open with its default app on IOS #272

Open yoscar1 opened 4 years ago

yoscar1 commented 4 years ago

Expected Behaviour

when you open the file that it opens with its default application, for example if it is an excell file that is opened with the ios excel application.

Actual Behaviour

In IOS when I try to open an .xlsx or .docx file, the plugin opens the file, the promise is executed correctly: but the file is not opened with the native app (in this case Excell or word) rather it opens as seen in the image below: capture.png

Reproduce Scenario (including but not limited to)

I click on an .xlsx file, and instead of opening it with the excell app for ios that is already installed, it opens like the image above

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

IOS 13.1, iPhone 6s

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Cordova CLI info

cordova info

Here is the output:

Collecting Data... Node version: v10.15.3 Cordova version: 8.1.1 Config.xml file: <?xml version='1.0' encoding='utf-8'?>

ECOBPM ECOBPM app ECOBPM We need this to let you take pictures as notes We need this to let you pick photos from your library We need this to save the photos in your library We need this to let you know how close you are to a site Required to send your location to your dispatcher

Plugins: cordova-annotated-plugin-android,cordova-play-services-version-adapter,cordova-plugin-actionsheet,cordova-plugin-analytics,cordova-plugin-android-permissions,cordova-plugin-androidx,cordova-plugin-androidx-adapter,cordova-plugin-badge,cordova-plugin-camera,cordova-plugin-datepicker,cordova-plugin-device,cordova-plugin-dialogs,cordova-plugin-file,cordova-plugin-file-opener2,cordova-plugin-file-transfer,cordova-plugin-filepath,cordova-plugin-inappbrowser,cordova-plugin-ionic-keyboard,cordova-plugin-ionic-webview,cordova-plugin-ios-camera-permissions,cordova-plugin-local-notification,cordova-plugin-mauron85-background-geolocation,cordova-plugin-media-capture,cordova-plugin-network-information,cordova-plugin-splashscreen,cordova-plugin-statusbar,cordova-plugin-whitelist,phonegap-plugin-push,uk.co.workingedge.phonegap.plugin.launchnavigator iOS platform: Xcode 10.1 Build version 10B61

Plugin version

cordova plugin version | grep cordova-plugin-file-opener2

Here is the output: cordova-plugin-file-opener2 2.2.1 "File Opener2"

Sample Code that illustrates the problem

this.fileOpener.open(this.dataFile.file.PathUri,this.dataFile.file.fileBlob.type).then(data=>{ console.log("se abrio el archivo",data); }).catch(error=>{ console.log("no se abrio el archivo con un app nativa",error); //intento abrirlo con el navegador this.loadingService.showToast("No existe una APP compatible con este tipo de archivo, abriendo con el navegador","bottom",true,2000); setTimeout(()=>{ if(this.dataFile.file.url!=null) this.iab.create (this.dataFile.file.url, '_system', 'location = yes, hardwareback = yes'); },2000); });

Logs taken while reproducing problem

vahid18u commented 4 years ago

I have a similar problem. when I use showOpenWithDialog method, it works in android and let user select what app to open with, but in iOS 12.4.5 nothing happens and surprisingly it does not call error function! it calls success but nothing happens. this is my code:

FileOpener.showOpenWithDialog( myPath, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", { error: function(e) { console.log(e); }, success: function() { console.log("success"); } } );

I need to mention that it works on iOS 13.3 perfectly fine

whodeee commented 3 years ago

Having the same issue iOS 13.3.1 does not open the correct app, it just opens the preview (Quicklook) instead when calling the open() method

Umesh079 commented 3 years ago

is there any update @whodeee , did you found any solution for it?

whodeee commented 3 years ago

@Umesh079 I have not found a solution to this unfortunately. I am currently resorting to using the Dialog option and don't really like that. I am hoping a fix comes for this.

vvarda commented 3 years ago

Guys, that issue is actual - it doesn't work on IOS.

FireLizard commented 3 years ago

Same here and I have no clue how to solve it.