File Opener2 plugin not found

#1

Hello,

I’m developing a simple app for iOS and I’m trying to use the file-opener2 native plugin, among others.

I installed without problems the plugin using the following commands:

  • ionic cordova plugin add cordova-plugin-file-opener2
  • npm install --save @ionic-native/file-opener

All went OK and no error at all.

But when I try to use it, the error “plugin not installed” appears in the console log.

I’m using an iPhone 5 through Ionic DevApp.

Ionic Info

Ionic:

   ionic (Ionic CLI)  : 4.8.0 (C:\Users\lamanna\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 7 other plugins)

System:

   NodeJS : v8.9.2 (C:\Program Files\nodejs\node.exe)
   npm    : 5.5.1
   OS     : Windows 10

cordova plugin ls

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.1.3 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.3.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

This is the calling code

this.fileOpener.open(f.toURL(), this.doc.content_type)
          .then( () => {
            console.log("OPENED");
          })
          .catch( e => this.error(e) );

Thanks,

Marco

#2

The Ionic DevApp only supports a subset of all the Ionic Native plugins. I think that one is NOT one of them, so it would be unavailable to your app. You will need to compile your application in the traditional manner to test it.

#3

Thanks for your answer.

So, if I build my app with the online ionic service for the iOS system I could debug it with an iPhone attached at USB port of my PC (I don’t own a Mac)?

Sorry for the basic question but I’m a newbie :slight_smile:

Thanks,

Marco