Thank you Dawson! The problem mentioned below has been solved in android. But sadly it does not work when I build the project in ios, could anyone help?
You wont be able to call that function until after the deviceReady event has fired.
For testing I always take my plugin function and add it as a click action to the "device is ready" p tag.
Example:
Device is Ready
change to:
Device is Ready
I do this with the default cordova example app since I know that 'Device is ready' will not display until after the deviceReady event has fired. This is a good way to test if plugins are working before you do any real work on your project.