me.apla.cordova.app-preferences
me.apla.cordova.app-preferences copied to clipboard
Promise interface of prefs.fetch('key') does not work on Android 4.x.x
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!
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.