This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Keychain from 'react-native-keychain'; | |
import DeviceInfo from 'react-native-device-info' | |
async () => { | |
const username = 'adhithi'; | |
const password = 'poniesRgr8'; | |
const server = DeviceInfo.getBundleId() | |
// Store the credentials | |
await Keychain.setInternetCredentials(server, email, password).then(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keychain.getInternetCredentials(server).then(credentials => { | |
if (credentials) { | |
console.log('Credentials successfully loaded for user ' + credentials.username) | |
} | |
else { | |
console.log('Could not retrieve credentials for server') | |
} | |
}).catch(error => { | |
console.log('Could not get credentials from keychain') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using react-native-device-info to get server information | |
const server = DeviceInfo.getBundleId() | |
Keychain.setInternetCredentials(server, email, password).then(() => { | |
console.log('Saved internet credentials') | |
}).catch(error => { | |
console.log('Could not save credentials') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keychain.getSupportedBiometryType().then(biometryType => { | |
this.setState({ biometryType }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Keychain from 'react-native-keychain'; | |
async () => { | |
const username = 'zuck'; | |
const password = 'poniesRgr8'; | |
// Store the credentials | |
await Keychain.setGenericPassword(username, password); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React, { Component } from 'react'; | |
import { | |
AlertIOS, | |
StyleSheet, | |
Text, | |
TouchableHighlight, | |
View, | |
} from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clickHandler() { | |
TouchID.isSupported() | |
.then(biometryType => { | |
// Success code | |
if (biometryType === 'FaceID') { | |
console.log('FaceID is supported.'); | |
} else if (biometryType === 'TouchID'){ | |
console.log('TouchID is supported.'); | |
} else if (biometryType === true) { | |
// Touch ID is supported on Android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
AlertIOS, | |
StyleSheet, | |
Text, | |
TouchableHighlight, | |
View, | |
NativeModules | |
} from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React, {Component} from 'react'; | |
import {Platform, StyleSheet, Text, View} from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import PropTypes from 'prop-types' | |
import { View, StyleSheet } from 'react-native' | |
import Video from 'react-native-video' | |
export default class VideoComponent extends React.Component { | |
renderVideo () { | |
return( | |
<Video |
NewerOlder