New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova plugins are not working with this #4

Open
vikramIde opened this Issue Jul 13, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@vikramIde
Copy link

vikramIde commented Jul 13, 2017

Hello so ,

I installed a cordova plugin in the project using the

cordova add plugin cordova-plugin-barcodescanner

in my config.xml i can see it added

<plugin name="cordova-android-play-services-gradle-release" spec="0.0.2" />
    <plugin name="cordova-plugin-barcodescanner" spec="^0.7.0" />
    <plugin name="cordova-plugin-whitelist" spec="1" />

but I was not able to access the cordova.plugin variable in my project so I added following lines of code
in main.js

import VueCordova from 'vue-cordova';
// BarCode Scanner 
Vue.use(VueCordova, {
  optionTestKey: 'optionTestValue'
})

Then tried to access the plugin again
console.log(Vue.cordova.plugins);
This time i was able to access the cordova object but
I get plugin array as empty no plugin inside that , Any Idea what could be a problem ?

@lucabartoli

This comment has been minimized.

Copy link

lucabartoli commented Oct 18, 2017

vue-cordova supports only some plugins and barcodescanner isn't one of them.
I'm trying to figure out how to use cordova plugins without using wrappers like vue-cordova

@valgaze

This comment has been minimized.

Copy link

valgaze commented Apr 21, 2018

+1

@lucabrtoli or @vikramlde any word on this or working examples you've found?

One clue is that "cordova" globally isn't defined anywhere.

Not sure if related, but this template's build doesn't appear to copy "cordova.js" to www (if using platform ios, located in: platforms/ios/CordovaLib/)

These folks describe a convoluted way to get vue-cordova to kind of work but no luck.

I'm trying to achieve exactly the same thing (with that specific plugin), very eager to hear any ideas.

Some semi-useful SO links:

@ehausen

This comment has been minimized.

Copy link

ehausen commented May 8, 2018

@valgaze
Did the last comment in the stackoverflow thread you posted help you? https://stackoverflow.com/a/48193369/3027622

@valgaze

This comment has been minimized.

Copy link

valgaze commented May 8, 2018

@ehausen it did not. I ended up ditching vue-Cordova & this template entirely.

This is a working template (using an older version of f7, the author allegedly is working on v3 at this point):

https://github.com/bingobongotmp/f7_barcodescanner_vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment