0.3.0 • Published 3 years ago

@bobbyecho/react-native-humanid v0.3.0

Weekly downloads
55
License
SEE LICENSE IN LI...
Repository
github
Last release
3 years ago
linking assets (IMPORTANT)
npx react-native link

Credentials Access

Get the appId and appSecret by dropping us an email developers@human-id.org.

Configuration

at your index.js file

import {configureHumanID} from "react-native-humanid"  
import AppLogo from "path/your-app-logo"  
  
configureHumanID({  
    appName: "Your application NAme",
    clientSecret: "APP_SECRET",
    clientId: "APP_ID",
    Icon: AppLogo (Icon is JSX.Element)
})  
  
AppRegistry.registerComponent(appName, () => App)  

How to use

Register humanID Provider at your Top Container Application

import {HumanIDProvider} from "react-native-humanid"  
  
const App = () => {  
    return (
        <View>
            <HumanIDProvider />
        </View>
    )
}  
  
export default App  

Login

import {logIn} from "react-native-humanid"  
  
const HomeScreen = () => {  
    const handleLogin = () => {
        logIn()
    }
    
    return <Button title="Login" onPress={handleLogin} />
}  
  
export default HomeScreen  

Listener onSuccess, onError, onCancel

We suggest put this method into lifecycle that only live once on your screen, example: componentDidMount if you use class component, otherwise you can use useEffect

import {onCancel, onSuccess, onError} from "react-native-humanid"  
  
const HomeScreen = () => {  
    React.useEffect(() => {
        onSuccess((exchangeToken) => {
            console.log("exchangeToken", exchangeToken)
        })
        onError((message) => {
            console.log("error message", message)
        })
        onCancel(() => {
            console.log("canceled")
        })
    }, [])
}  
 
export default HomeScreen  

You're set!

Now you can integrate your React Native app to humanID. See the full sample here to learn more.

License

Copyright 2019-2020 Bluenumber Foundation Licensed under the GNU General Public License v3.0

0.3.0

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago