me.apla.cordova.app-preferences icon indicating copy to clipboard operation
me.apla.cordova.app-preferences copied to clipboard

Promise interface of prefs.fetch('key') does not work on Android 4.x.x

Open sdurandeu opened this issue 8 years ago • 1 comments

Using the following method fails with the error: Error in Success callbackId: .... It does not call the fail callback.

// fetch the value for a key using promise
prefs.fetch ('key').then (ok, fail);

Instead, I used the non-promised version prefs.fetch (ok, fail, 'key'); and it worked successfully. I reviewed the implementation and it looks it cannot find a valid Promise object in this section. It seems like the global Promise is not supported in Android 4.

Let me know if I'm missing something. Not sure is actually an issue of the library, so feel free to close, but might be useful for reference.

Thanks!

sdurandeu avatar May 12 '16 20:05 sdurandeu

Promise interface will work only if you have a proper promise interface. Android 4.x is quite old and mostly not supports promises. Callback version should work every time.

apla avatar Jul 06 '16 15:07 apla