improve consistency and docs (#114)

* Update KeychainModule.java

* Update README.md
This commit is contained in:
Vojtech Novak 2018-03-13 16:24:58 +01:00 committed by GitHub
parent 43b1f870f0
commit ee959ba42e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -47,11 +47,11 @@ Both `setGenericPassword` and `setInternetCredentials` are limited to strings on
### `setGenericPassword(username, password, [{ accessControl, accessible, accessGroup, service }])`
Will store the username/password combination in the secure storage. Resolves to `{ username, password }` if an entry exists or `false` if it doesn't.
Will store the username/password combination in the secure storage. Resolves to `true` or rejects in case of an error.
### `getGenericPassword([{ authenticationPrompt, service }])`
Will retreive the username/password combination from the secure storage. It will reject only if an unexpected error is encountered like lacking entitlements or permission.
Will retreive the username/password combination from the secure storage. Resolves to `{ username, password }` if an entry exists or `false` if it doesn't. It will reject only if an unexpected error is encountered like lacking entitlements or permission.
### `resetGenericPassword([{ service }])`

View File

@ -68,7 +68,7 @@ public class KeychainModule extends ReactContextBaseJavaModule {
EncryptionResult result = currentCipherStorage.encrypt(service, username, password);
prefsStorage.storeEncryptedEntry(service, result);
promise.resolve("KeychainModule saved the data");
promise.resolve(true);
} catch (EmptyParameterException e) {
Log.e(KEYCHAIN_MODULE, e.getMessage());
promise.reject(E_EMPTY_PARAMETERS, e);
@ -210,4 +210,4 @@ public class KeychainModule extends ReactContextBaseJavaModule {
private String getDefaultServiceIfNull(String service) {
return service == null ? EMPTY_STRING : service;
}
}
}