Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.06 KB

README.md

File metadata and controls

49 lines (34 loc) · 1.06 KB

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!