[SOLVED] Working with cordova plugins in Quasar

  • I’m new to quasar (I’m using v0.15) and cordova, I need to use a certain plugin: Insomnia.

    What’s the best practice or recommended approach in using such plugins within Quasar?

    After adding the plugin, I need to use the actual api by invoking window.plugins.insomnia.keepAwake(), I was wondering where should Implement this? Will this be automatically available in my app upon adding the plugin, or should I cd in to src-cordova and implement it there?

    Lastly, I take it that whatever the approach was, would work to all cordova plugins that I would need to add in the future?

  • Was able to solve this, Razvan gave me a link when I inquired on the gitter channel: Cordova Plugins This will surely be available upon the release of v0.15 docs.

    Although I encountered some problems as well,

    • Plugin’s codes didn’t work whenever I used it on App.vue but it worked on other vue files. This must be a vue or vue template thing, just haven’t got the time to figure it out. Maybe you guys know the answer.
    • I’m using cordova run to make my changes ‘persist’. Using quasar dev -m cordova won’t really work when the device is not plugged in. I have to do a quasar build -m cordova before I run cordova run though or else changes that I see on quasar dev -m cordova will not reflect.

    Again, there might a proper way of doing this. Things will probably get clearer when v0.15 docs came out.

Log in to reply