Get data with the Cordova NativeStorage Plugin error


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:

      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.

try reinstalling native storage plugin

Thank you, i remove and install it again but nothing changed :frowning: another ideas?

Ah… I think the code:2 means Item not found error.
This might be helpful

1 Like

Yes, i know. Code 2 means that no item found. This is strange because i have this problem only if i save NSDictionary on iOS Native side. This error does not appear if i save booleans or string.

Another thing: when i print all available keys, i saw the key of the NSDictionary :confused: