Giter Site home page Giter Site logo

react-native-firebase-auth's Introduction

This is the react-native implementation of https://github.com/SolidStateGroup/simple-firebase-auth

React Native Firebase Auth

Gitter

Simplified Firebase authentication for React Native projects with support for Facebook & Google login.

Using this module alongside Firebase means there is no need to write and host any backend code to handle users logging in to your app.

Use our project starter repository (https://github.com/SolidStateGroup/firebase-project-starter) to help you get started setting up your own Firebase project.

Installation

$ npm install --save react-native-firebase-auth

Note: If you use React Native < v0.39 or you are already using react-native-google-signin then stick with v0.0.11 (npm install [email protected] --save)

Project Setup

$ npm install --save firebase react-native-facebook-login react-native-google-sign-in

You will need fully setup both of the below social platform dependencies (react-native-google-sign-in and react-native-facebook-login).

https://github.com/joonhocho/react-native-google-sign-in#getting-started https://github.com/magus/react-native-facebook-login#setup

You will need to initialise Firebase within your app in the usual way. See https://firebase.google.com/docs/web/setup

Usage

import FireAuth from 'react-native-firebase-auth';

constructor(props) {
  super(props);
  FireAuth.init({iosClientId: <IOS_CLIENT_ID>}); // This is the CLIENT_ID found in your Google services plist.
}

componentDidMount() {
  FireAuth.setup(this.onLogin, this.onUserChange, this.onLogout, this.emailVerified, this.onError);
}

register = () => {
  const { email, password, firstName, lastName } = this.state;
  FireAuth.register(email, password, { firstName, lastName });
}

login = () => {
  FireAuth.login(this.state.email, this.state.password);
}

loginAnonymously = () => {
  FireAuth.loginAnonymously();
}

facebookLogin() {
  FireAuth.facebookLogin();
}

googleLogin() {
  FireAuth.googleLogin();
}

logout() {
  FireAuth.logout();
}

update () => {
  FireAuth.update({
    firstName: this.state.firstName,
    lastName: this.state.lastName
  }).then(() => {
    ...
  }).catch(err => {
    ...
  });
}

resetPassword () => {
  FireAuth.resetPassword(this.state.email)
    .then(() => {
      ...
    })
    .catch(err => {
      ...
    });
}

updatePassword () => {
  FireAuth.updatePassword(this.state.password)
    .then(() => {
      ...
    })
    .catch(err => {
      ...
    });
}

Credits

https://github.com/magus/react-native-facebook-login

https://github.com/joonhocho/react-native-google-sign-in

Getting Help

If you encounter a bug or feature request we would like to hear about it. Before you submit an issue please search existing issues in order to prevent duplicates.

Contributing

For more information about contributing PRs, please see our Contribution Guidelines.

Get in touch

If you have any questions about our projects you can email [email protected].

react-native-firebase-auth's People

Contributors

altescape avatar dabeeeenster avatar kyle-ssg avatar lukefanning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-firebase-auth's Issues

¿how can use callback in FB or GG login?

i can`t use the callback .then:

facebookLogin() { FireAuth.facebookLogin() .then((res) => { console.log(res) ) }

googleLogin() { FireAuth.googleLogin() .then((res) => { console.log(res) ) }

How can know if the user is logged?

How check if login is correct?

Hi, thanks for your repo, congratulations.

I have been able to authenticate with Facebook and Google, but I can not check if the user has authenticated correctly to send it to another screen

How use this.onLogin, this.onUserChange, this.onLogout, this.emailVerified, this.onError

Wrong packages for Google

I am getting this error:
npm WARN [email protected] requires a peer of react-native-google-signin@>=0.8.0 but none was installed.

But your docs have a completely different package listed as the dependency.
react-native-google-signin vs react-native-google-sign-in

So is it this package https://github.com/joonhocho/react-native-google-sign-in#getting-started or this package needed https://github.com/devfd/react-native-google-signin?

Developer_error 10 when trying to login with google

I am able to get the popup to select which google account I wish to use, however when I select a profile the modal disapears and I get an error saying:
{ code: 10, error: 'DEVELOPER_ERROR' }

any help would be much appreciated

Return user information from Google Sign in or FB

I've just started using this component, thanks for the hard work! I may be missing something but I'm wondering if there's any way to return more information about the connecting user via the Google Sign In and Facebook integration.

For instance, in the Google Sign In function you're making a call to the GoogleSignIn.signInPromise() method which returns a user object. However, you are just passing the token back to the FireAuth wrapper and then registering it with Firebase. I would ideally like to access the information in the user object, specifically the name for purposes within my app.

Is there any way to do this? Like I said I may just be missing something trivial.

Thanks!

auth/too-many-requests

auth/too-many-requests
this error is coming out during login using firebase auth and I tried to put some time out for request but it does not work
so please give me solution

Don't you need to init your firebase?

It's not showing in the example that you init the firebase itself.

Also are you sure the firebase.auth() will always return the same variable? Why don't you store it in a global variable fireauth so that later on users can use the fireauth.storage.ref() etc?

Phone Auth

Any plans to support Phone Auth that is going to replace Twitter Digits?

How do I increase permissions on facebookLogin?

Ive implemented my facebook login but when i see my firebase it just shows email and if email is verified i want more of the user's data how do I do that? Like friends and news feed and stuff?

What is IOS_CLIENT_ID and where/how do I obtain it???

Is it the same thing as the FacebookAppID??? And if the same, it should be a string, not a number, correct?

If not the same, where/how do I obtain an IOS_CLIENT_ID???

Also, if it's an 'IOS_CLIENT_ID', then why does the comment right next to it claim that it's a 'Google Sign in options'???

FireAuth.init({iosClientId: <IOS_CLIENT_ID>}); // Google Sign in options. You will need iosClientId for iOS apps.

Firebase auth only for Facebook

Hi,
Is there an option to use react-native-firebase-auth without react-native-google-signin ?
When I try to use it only with react-native-facebook-login I get an exception.
I just need Facebook authentication in my app.

Thanks,
Amir.

On register, pushes an object to firebase

when registering a user, the library (either yours or the ones that it implements to make the login work for social platforms) is pushing an object onto the firebase database under 'profiles'. I'm pushing an object of my own to track the user the way i'd like to on the database, so I was trying to figure out where to either edit this functionality or disable it entirely and use my own implementation, but I can't seem to figure out where the library is making that happen. Any guidance would be greatly appreciated!

Module does not exist in the module map

Someone with this issue?
react-native: 0.49.3

UnableToResolveError: Unable to resolve module react-native-facebook-login from /Users/dcalix/booty/node_modules/react-native-firebase-auth/auth.js: Module does not exist in the module map

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.