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
// 2️⃣ onRegister: Trust this device | |
const onRegister = () => { | |
var cotter = new Cotter( | |
API_KEY_ID, // 👈 Specify your API KEY ID here | |
email, | |
); | |
cotter.trustedDevice.enrollDevice( | |
(resp) => { alert('Register Device Success'), console.log(resp) }, | |
(errMsg, err) => { alert(errMsg), console.log(err) }, | |
); |
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
// 2️⃣ onLogin: Sign In with Device | |
const onLogin = () => { | |
var cotter = new Cotter( | |
API_KEY_ID, // 👈 Specify your API KEY ID here | |
email, | |
); | |
cotter.trustedDevice.requestAuth( | |
'LOGIN', | |
(resp) => { alert('Login Success'), console.log(resp) }, | |
(errMsg, err) => { alert(errMsg), console.log(err) }, |
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
yarn add react-native-cotter react-native-device-info rn-secure-storage react-native-randombytes react-native-camera react-native-svg react-native-securerandom buffer react-native-inappbrowser-reborn react-native-sha256 | |
npx pod-install ios |
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
// App.js | |
// 1️⃣ Import Cotter's Wrapper | |
import {connectCotterWrapper} from 'react-native-cotter'; | |
function App() {...} | |
// 1️⃣ At the bottom: Wrap your root component with Cotter's wrapper | |
export default connectCotterWrapper(App); |
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
// 2️⃣ Import Cotter's package | |
import { Cotter } from "react-native-cotter"; |
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
npx react-native init PenguinApp |
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
cd PenguinApp | |
npx react-native run-ios |
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
npx react-native run-ios |
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
npm install -g @angular/cli |
OlderNewer