Skip to content

nathvarun/React-Native-Firebase-Tutorials

Repository files navigation

Project files for the react native firebase tutorial series on youtube.

Tutorial #3 Facebook-Login Complete Project Files.

  • Learn how to add Facebook Login to Your React Native + Firebase App.

Install Dependencies

npm install 

Configure App.js

// Initialize Firebase
const firebaseConfig = {
  // ADD YOUR FIREBASE CREDENTIALS
  apiKey: "",
  authDomain: "",
  databaseURL: "",
  projectId: "",
  storageBucket: "",
};

Add your Facebook App Id

  async loginWithFacebook() {

    //ENTER YOUR APP ID 
    const { type, token } = await Expo.Facebook.logInWithReadPermissionsAsync('<APP ID>', { permissions: ['public_profile'] })

    if (type == 'success') {

      const credential = firebase.auth.FacebookAuthProvider.credential(token)

      firebase.auth().signInWithCredential(credential).catch((error) => {
        console.log(error)
      })
    }
  }

That's all you need!

About

All Tutorial Files for Youtube Tutorial Series

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published