Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229670

Get data with the Cordova NativeStorage Plugin error

$
0
0

hi,

i have an native iOS app in the Appstore that using NSUserdefaults to save information. Now i develope the same App with Ionic and want a access to this NSUserdefaults object. The problem is i receive errors. Here are the following codes:

IOS Native side:

NSMutableDictionary *theNames = ...WITH SOME DATAS;

NSUserDefaults *profile = [NSUserDefaults standardUserDefaults];
[profile setObject:dictOfButtonNames forKey:@"theNames"];

On Cordova/Ionic side i use the Plugin NativeStorage and this following code:

this.nativeStorage.getItem('theNames')
    .then(
      data => console.log(data),
      error => console.error(error)
   );

This is the Error in my renewed App:

ERROR: {“code”:2,“source”:“Native”,“exception”:null,"__zone_symbol__currentTask":{“type”:“macroTask”,“state”:“notScheduled”,“source”:“setTimeout”,“zone”:"",“cancelFn”:null,“runCount”:0}}

Note: I test the same successful with boolean variable.


Viewing all articles
Browse latest Browse all 229670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>