cordova-plugin-file-opener2
cordova-plugin-file-opener2 copied to clipboard
the file does not open with its default app on IOS
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:
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
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
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
is there any update @whodeee , did you found any solution for it?
@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.
Guys, that issue is actual - it doesn't work on IOS.
Same here and I have no clue how to solve it.