pwlin / cordova-plugin-file-opener2

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

Usage in Capacitor #322

Closed vilasp closed 3 years ago

vilasp commented 3 years ago

I'm currently working in a project (plain React, no Ionic native) which uses Capacitor v3 (could of course revert to v2) and i was wondering if this plugin is possible to use with this set up and if so how to include and use it in the project?

Currently I've tried to install the package according to Capacitor docs

  1. npm install cordova-plugin-file-opener2
  2. npx cap sync

but I'm getting Module not found: Can't resolve 'cordova-plugin-file-opener2'`, i understand that it might not be existing any typescript wrappers for this like it does for the official Capacitor plugins (I could see that they existed for Ionic Native) but i was wondering what the correct set up would be.

vilasp commented 3 years ago

After reading the documentation a bit better this was something on my end, if anyone is wondering how it is supposed to be done... you could use the native typescript wrappers provided from ionic native without actually running Ionic. See the first two lines of the documentation for installing ionic native in capacitor project here