TheCocoaProject / cordova-plugin-nativestorage

Cordova plugin: Native storage of variables in Android, iOS and Windows
http://thecocoaproject.github.io/
Apache License 2.0
292 stars 106 forks source link

Plugin works on browser but not on phone #119

Closed TakshPSingh closed 5 years ago

TakshPSingh commented 6 years ago

I am using the Phonegap CLI to serve my project and my plugin version is: 2.3.1

So, I wrote the following code to execute after the device is ready:

 NativeStorage.getItem("abcd", function() {
     console.log("success");
     alert("success");
 }, function() {
     console.log("fail");
     alert("failed :)");
 });

This works perfectly when I am testing it on my browser. However, when I open this app on my android phone, the NativeStorage code does not work at all.

I used weinre to debug my app:

I got the error: ReferenceError: NativeStorage is not defined

Image of the error

I also removed the plugin and all the platforms and reinstalled them again; however, I am still getting the same error.

Can you please help me find the issue ?

GillesC commented 6 years ago

See if issue #82 resolves your problem.

GillesC commented 5 years ago

Closed due to inactivity. Will reopen if necessary.