https://github.com/ionic-team/cordova-plugin-ios-keychain
Apache Cordova (PhoneGap) plugin
https://github.com/ionic-team/cordova-plugin-ios-keychain
Last synced: 7 months ago
JSON representation
Apache Cordova (PhoneGap) plugin
- Host: GitHub
- URL: https://github.com/ionic-team/cordova-plugin-ios-keychain
- Owner: ionic-team
- License: other
- Fork: true (SpiderOak/KeychainPlugin)
- Created: 2016-07-14T18:43:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T14:34:48.000Z (about 4 years ago)
- Last Synced: 2025-01-18T21:58:27.619Z (over 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 65.4 KB
- Stars: 64
- Watchers: 11
- Forks: 44
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Keychain Plugin for Apache Cordova
=====================================
created by Shazron Abdullah
Updated by Max Lynch
_Maintenance Status_:
Looking for maintainer. PRs and community contributions welcome.
### Alternative: Enterprise Keychain and Keystore
For enterprise use cases requiring secret storage with biometric authentication for iOS (keychain) and Android (Keystore), see [Identity Vault](https://ionicframework.com/enterprise/identity-vault).
### Installation
```shell
cordova plugin add https://github.com/ionic-team/cordova-plugin-ios-keychain
```
### iCloud keychain enabled
iCloud keychain synchonizing is enabled, so the keychain will be mirrored across all devices *if* the user is signed in to iCloud (Settings > iCloud) and has iCloud keychain turned on (Settings > iCloud > Keychain)
### Usage
See the **example** folder for example usage.
```js
/*
Retrieves a value for a key
@param successCallback returns the value as the argument to the callback when successful
@param failureCallback returns the error string as the argument to the callback, for a failure
@param key the key to retrieve
@param TouchIDMessage the message to show underneath the TouchID prompt (if any)
*/
Keychain.get(successCallback, failureCallback, 'key', 'TouchID Message');
/*
Sets a value for a key
@param successCallback returns when successful
@param failureCallback returns the error string as the argument to the callback, for a failure
@param key the key to set
@param value the value to set
@param useTouchID whether to store the value with security such that TouchID will be needed to grab it
*/
Keychain.set(successCallback, failureCallback, 'key', 'value', useTouchID);
/*
Removes a value for a key
@param successCallback returns when successful
@param failureCallback returns the error string as the argument to the callback
@param key the key to remove
*/
Keychain.remove(successCallback, failureCallback, 'key');
/*
Sets a JSON value for a key
@param successCallback returns when successful
@param failureCallback returns the error string as the argument to the callback, for a failure
@param key the key to set
@param value the value to set
@param useTouchID whether to store the value with security such that TouchID will be needed to grab it
*/
Keychain.setJson(successCallback, failureCallback, 'key', 'value', useTouchID);
/*
Gets a JSON value for a key
@param successCallback returns when successful
@param failureCallback returns the error string as the argument to the callback, for a failure
@param key the key to set
@param value the value to set
@param useTouchID whether to store the value with security such that TouchID will be needed to grab it
*/
Keychain.getJson(successCallback, failureCallback, 'key', useTouchID);
```
### License
[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html) except for the Auth0 SimpelKeychain code that is under MIT