Closed gazever closed 9 years ago
Hi this behaves differently on Android to iOS.
On iOS if there is no value when fetching a key null is returned to the success callback, on android the errorCallback is called
line 145 : if (sharedPrefs.contains(key)) { ....
line 177 : } else { // Log.d("", "no value"); callbackContext.error(0); // callbackContext.sendPluginResult(new PluginResult ()); }
To rectify and fit my needs I changed this in the else line 177 : } else { // Log.d("", "no value"); callbackContext.success(returnVal); }
as returnVal is declared as null on line 144.
In my personal opinion I think its better for them both to return null to the success callback rather than the call the error callback
ok, can you send me a pull request?
fixed with ff52c73503331a90fe34e0b62fc7498bfe2f23f6
Hi this behaves differently on Android to iOS.
On iOS if there is no value when fetching a key null is returned to the success callback, on android the errorCallback is called
line 145 : if (sharedPrefs.contains(key)) { ....
line 177 : } else { // Log.d("", "no value"); callbackContext.error(0); // callbackContext.sendPluginResult(new PluginResult ()); }
To rectify and fit my needs I changed this in the else line 177 : } else { // Log.d("", "no value"); callbackContext.success(returnVal); }
as returnVal is declared as null on line 144.
In my personal opinion I think its better for them both to return null to the success callback rather than the call the error callback