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

NativeStorage.keys Usage #102

Closed AdobeWordPress closed 6 years ago

AdobeWordPress commented 6 years ago

Hey,

I have a two questions about NativeStorage.keys

  1. I want to get all keys in NativeStorage and if they start with date word, alert them. This is my code.
        NativeStorage.keys(function(result){
            for (var i in result) {
                if (i.substring(0, 4) == "date=") {
                    alert(result);
                }
            }
        },null);
  1. How to get value of the key while using NativeStorage.keys? Sample code :
        NativeStorage.keys(function(key,value){
               alert(key+' : ' + value);
            }
        },null);

Thanks!

alokrajiv commented 6 years ago

Thank you for using the plugin. We are very happy you find it useful.

The issue page is meant to post issues, errors and other problems related to our plugin. Your problem is a usage problem and thus should be posted in a forum such as StackOverflow (where you can use our tag cordova-nativestorage).

I am going to close this issue and will be more than happy to answer such questions in SO.

Thank you but sorry again!