Fixes callback on saving and resetting the password on android (#24)

* invoke callback after saving

* invoke callback after pw reset
This commit is contained in:
Vojtech Novak 2016-06-02 22:35:46 +02:00 committed by Joel Arvidsson
parent 60455e88ce
commit 040b2c2128
1 changed files with 2 additions and 0 deletions

View File

@ -66,6 +66,7 @@ public class KeychainModule extends ReactContextBaseJavaModule {
prefsEditor.putString(service + ":p", encryptedPassword);
prefsEditor.apply();
Log.d("KeychainModule saved: ", service + encryptedUsername + ":" + encryptedPassword);
callback.invoke("", "KeychainModule saved the data");
} catch (Exception e) {
Log.e("KeychainModule ", e.getLocalizedMessage());
callback.invoke(e.getLocalizedMessage());
@ -124,6 +125,7 @@ public class KeychainModule extends ReactContextBaseJavaModule {
prefsEditor.remove(service + ":u");
prefsEditor.remove(service + ":p");
prefsEditor.apply();
callback.invoke("", "KeychainModule password was reset");
} catch (Exception e) {
//this probably never happens but it is here so that the android api is the same as on iOS
callback.invoke(e.getLocalizedMessage());