/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow * @lint-ignore-every XPLATJSCOPYRIGHT1 */ import React, {Component} from 'react'; import {Platform, StyleSheet, Button, Text, TextInput, View} from 'react-native'; import RNSecureKeyStore, {ACCESSIBLE} from "react-native-secure-key-store"; type Props = {}; export default class App extends Component { state = { alias: 'hello', value: 'world' }; getValue() { RNSecureKeyStore.get(this.state.alias) .then((value) => { this.setState({ value, }); }) .catch(console.error); } setValue() { RNSecureKeyStore.set(this.state.alias, this.state.value, {}) .then(() => this.getValue()) .catch(console.error); } removeValue() { RNSecureKeyStore.remove(this.state.alias) .then(() => this.getValue()) .catch(console.error); } render() { return ( Alias: this.setState({alias})} value={this.state.alias} /> Value: this.setState({value})} value={this.state.value} />