rn-expo-firebase-auth
Installation ------------ ``` npm i -S rn-expo-firebase-auth ```
Last updated 2 years ago by yangga .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rn-expo-firebase-auth 
SYNC missed versions from official npm registry.

rn-expo-firebase-auth

Installation

npm i -S rn-expo-firebase-auth

Configure

It needs to set config variables into app.json

"extra": {
  "facebook": {
    "appId": "..."
  },
  "google": {
    "androidClientId": "...",
    "androidStandaloneAppClientId": "...",
    "iosClientId": "...",
    "iosStandaloneAppClientId": "...",
    "webClientId": "..."
  }
},

References

Usage

import RN_Expo_Firebase_Auth from 'rn-expo-firebase-auth'

const auth = new RN_Expo_Firebase_Auth()

// initialize module
await auth.initAsync()

// facebook login
auth.loginWithFacebook()
    .then(result => console.log('result', result))
    .catch(e => console.error(e))

// google login
auth.loginWithGoogle()
    .then(result => console.log('result', result))
    .catch(e => console.error(e))

// email sign-up. (just creating account)
auth.createWithEmailAndPassword('your email', 'your password')
    .then(result => console.log('result', result))
    .catch(e => console.error(e))

// email sign-in. (with created above)
auth.loginWithEmailAndPassword('your email', 'your password')
    .then(result => console.log('result', result))
    .catch(e => console.error(e))

// getting auth info
const authInfo = auth.getAuthInfo()
console.log('authInfo', authInfo)

// log out
await auth.logout()

// send reset password email. you can edit mail templates in firebase console (auth menu)
await auth.sendPasswordResetEmail()

More

After sign in/up, you can verify an 'idToken' if you have back-end server. All login methods return 'idToken' value. More infos are below

Donations

  • Bitcoin - 3FpD2rxMKbRMxgy92XUKrLVTAsTWAVP5zY
  • Ethereum - 0x9957406df18f7b0ff0dd48f75197dddc92603421
  • Tron - 0x3b3fcc4ff00bacc2c85452492d5b7de29363bf67
  • Bitcoin Cash - 3H2C6TVBZXGsWK44MsPT9YVKzzdEtLndim
  • Eos - 0x3b3fcc4ff00bacc2c85452492d5b7de29363bf67
  • Neo - AX4P3uAeS957wY4Kv4yHMgTwUvSamcKPp8
  • Ripple - rN9qNpgnBaZwqCg8CvUZRPqCcPPY7wfWep

Current Tags

  • 0.0.3                                ...           latest (2 years ago)

3 Versions

  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |