I am new to ionic-framework
, trying to implement shared prefrences in ionic platform for which cordovaPreferences is the plugin:
Then I am using:
$cordovaPreferences.store('key', 'myMagicValue')
.success(function(value) {
alert("Success: " + value);
})
.error(function(error) {
alert("Error: " + error);
})
But an alert is generated saying "Plugin not enabled":
Please Help.
You need to run this app in Android or iOS. Some plugins are not for the browser.
Following command is to add platform android
ionic platform add android
To build
ionic build android
To Emulate
ionic emulate android
If you are not satisfied with the emulation, after the build
command, just go to YourApp'sFolder\platforms\android\build\outputs\apk
and copy the apk
file to your device and install
Check that the plugin is working successfully