I'm trying to open PDF file in ionic with @ionic-native/file-opener and getting cordova problem.
Native: tried calling FileOpener.open, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
How can I solve it?
I'm trying to open PDF file in ionic with @ionic-native/file-opener and getting cordova problem.
Native: tried calling FileOpener.open, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
How can I solve it?
The only way to make cordova available is run the platform browser.
$ ionic cordova run browser
Are you running in a browser or emulator? You can use the Ionic CLI to run in an emulator, like so:
ionic cordova run android
If you have Cordova and the Android SDK set up, it should launch the emulator.
Copying @AjayGupta's answer from this thread:
If you want the plugin to work for the browser you should add platform browser and run it:
ionic cordova platform add browser
and run it:
ionic cordova run browser
instead ofionic serve
.