cordova-plugin-file-opener2 icon indicating copy to clipboard operation
cordova-plugin-file-opener2 copied to clipboard

the file does not open with its default app on IOS

Open yoscar1 opened this issue 5 years ago • 6 comments

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:

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

yoscar1 avatar Oct 10 '19 22:10 yoscar1

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

vahid18u avatar Mar 12 '20 09:03 vahid18u

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

whodeee avatar Aug 14 '20 15:08 whodeee

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

Umesh079 avatar Sep 09 '20 05:09 Umesh079

@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.

whodeee avatar Sep 09 '20 13:09 whodeee

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

vvarda avatar Mar 23 '21 10:03 vvarda

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

FireLizard avatar Jul 05 '21 09:07 FireLizard