improve consistency and docs (#114)
* Update KeychainModule.java * Update README.md
This commit is contained in:
parent
43b1f870f0
commit
ee959ba42e
|
@ -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 }])`
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue