add feature to example

This commit is contained in:
Vojtech Novak 2019-02-06 18:40:33 +01:00 committed by Igor Mandrigin
parent 77495c4cb9
commit 13d39e0b85
2 changed files with 20 additions and 2 deletions

View File

@ -128,6 +128,7 @@ export default class KeychainExample extends Component {
<Text style={styles.buttonText}>Save</Text>
</View>
</TouchableHighlight>
<TouchableHighlight
onPress={() => this.load()}
style={styles.button}
@ -136,6 +137,7 @@ export default class KeychainExample extends Component {
<Text style={styles.buttonText}>Load</Text>
</View>
</TouchableHighlight>
<TouchableHighlight
onPress={() => this.reset()}
style={styles.button}
@ -144,6 +146,22 @@ export default class KeychainExample extends Component {
<Text style={styles.buttonText}>Reset</Text>
</View>
</TouchableHighlight>
<TouchableHighlight
onPress={async() => {
if (Platform.OS !== 'android') {
alert('android-only feature');
return;
}
const level = await Keychain.getSecurityLevel();
alert(level)
}}
style={styles.button}
>
<View style={styles.load}>
<Text style={styles.buttonText}>Get security level</Text>
</View>
</TouchableHighlight>
</View>
</View>
</KeyboardAvoidingView>

View File

@ -2,9 +2,9 @@
buildscript {
ext {
buildToolsVersion = "27.0.3"
buildToolsVersion = "28.0.0"
minSdkVersion = 16
compileSdkVersion = 27
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}