Skip to main content
Version: v5

Keychain

Get and set data in the iOS Keychain

Requires Cordova plugin: cordova-plugin-ios-keychain. For more info, please see the Keychain plugin docs.

See also Secure Storage for more supported platforms.

https://github.com/ionic-team/cordova-plugin-ios-keychain

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation

$ npm install cordova-plugin-ios-keychain 
$ npm install @awesome-cordova-plugins/keychain
$ ionic cap sync

Supported Platforms

  • iOS

Usage

React

Learn more about using Ionic Native components in React

Angular

import { Keychain } from '@awesome-cordova-plugins/keychain/ngx';

constructor(private keychain: Keychain) { }

...

this.keychain.set(key, value).then(() => {
this.keychain.get(key)
.then(value => console.log('Got value', value))
.catch(err => console.error('Error getting', err));
})
.catch(err => console.error('Error setting', err));