apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

Getting Error In application preferences within Cordova #99

Open arirah opened 7 years ago

arirah commented 7 years ago

I have downloaded from the repo the plugin and it has installed successfully via the command line, however when I copy the test code they suggest into my .js file called by Cordova in my project, it says 'plugins' is undefined. The js code can be as simple as follows and result in this error:

var appp = plugins.appPreferences;

Same issue from another link

http://stackoverflow.com/questions/27968367/getting-application-preferences-within-cordova

apla commented 7 years ago

Cordova plugins relies on deviceready event. window.plugins is not available until this event is fired. If you're getting this error after deviceready, code and environment can help to understand what's going on.