From 126c69266e51b329caeb56f764040b5c99339523 Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Sun, 25 Feb 2018 16:16:22 +0100 Subject: [PATCH] Fix android related bugs in example app --- KeychainExample/app.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/KeychainExample/app.js b/KeychainExample/app.js index b24e6c1..87b50f9 100644 --- a/KeychainExample/app.js +++ b/KeychainExample/app.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { KeyboardAvoidingView, + Platform, StyleSheet, Text, TextInput, @@ -18,11 +19,7 @@ export default class KeychainExample extends Component { }; save() { - Keychain.setSecurePassword( - 'myService', - this.state.username, - this.state.password - ) + Keychain.setGenericPassword(this.state.username, this.state.password) .then(() => { this.setState({ status: 'Credentials saved!' }); }) @@ -32,7 +29,7 @@ export default class KeychainExample extends Component { } load() { - Keychain.getSecurePassword('myService') + Keychain.getGenericPassword() .then(credentials => { if (credentials) { this.setState({ ...credentials, status: 'Credentials loaded!' }); @@ -61,7 +58,10 @@ export default class KeychainExample extends Component { render() { return ( - + Keychain Example @@ -73,6 +73,7 @@ export default class KeychainExample extends Component { value={this.state.username} onChange={event => this.setState({ username: event.nativeEvent.text })} + underlineColorAndroid="transparent" /> @@ -84,6 +85,7 @@ export default class KeychainExample extends Component { value={this.state.password} onChange={event => this.setState({ password: event.nativeEvent.text })} + underlineColorAndroid="transparent" /> {!!this.state.status && (