apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 209 forks source link

prefs.fetch(ok, fail, 'key') returns array if key is not found (iOS 8) #29

Closed mirko77 closed 8 years ago

mirko77 commented 9 years ago

I am trying the plugin on iOS 8.1.2, Cordova iOS 3.8

when I do prefs.fetch(ok, fail, 'key'); and key does not exist, the ok callback is called with an array as value so I need to do an extra check only on iOS to make it work

apla commented 9 years ago

Fixed some issues for non-existing keys. Please install new version from github repo and report does it work for you.

jacobg commented 9 years ago

I see a similar issue. If I fetch a non-existing key in iOS, the ok handler is called with value null. On Android, the fail handler is called. Based on documentation, on iOS the fail handler should be called.

apla commented 9 years ago

@jacobg can you provide test case? what version you're using? just launched test for android and every test is pass. according to the test source (lines 48 and 78), there is a check for this issue.

apla commented 8 years ago

No response, have test for this, test passing