I did a lot of googling and couldn't seem to come up with much of an answer, how does the syntax of calling Cordova plugins in Ionic 2 work.
Like for example, in Ionic 1: I was using a facebook plugin, and I would call it like: $cordovaFacebook.login(["public_profile", "email","name","last_name","first_name","birthday","age_range","link"]).then(function (success) {
I would also 'inject' it and add it as a dependency. Both things I am not sure how to do with Ionic 2.
I read somewhere that with Ionic 2 that isn't as nesscary, but I am still unsure
Steps to use cordova plugin:
Add plugin
cordova plugin add [name of plugin]
Actually this is the only step to use cordova plugin. But there could be an error message when you're using Typescript. For example:
ERROR in [default] /Users/myname/Projects/ionic2/demo/app/pages/home/home.ts:21:12 Property 'device' does not exist on type 'Navigator'.
To fix the error message for Typescript. You can simple add this line to your .ts file, for example:
declare var navigator : any;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With