React Native - Firebase Facebook Auth
<p>Has anyone been able to succesfuly integrate Firebase Facebook Auth into React Native. I have been struggling with it for a few hours now and can't really figure out how to do it.</p>

<p>Here is what I have so far:</p>

<pre><code>import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

const FBSDK = require('react-native-fbsdk');
const {
  LoginButton,
  LoginManager,
  AccessToken
} = FBSDK;

import Button from './src/components/button';

//I had this populated with the correct stuff, just removed it for the stack overflow purpose
const firebase1 = require("firebase");
const firebaseConfig = {
  apiKey: "stuff",
  authDomain: "stuff",
  databaseURL: "stuff",
  storageBucket: "stuff",
};
const firebase = firebase1.initializeApp(firebaseConfig);

console.log("V2.5")
const auth = firebase.auth();
const provider = firebase.auth.FacebookAuthProvider;

class pack extends Component {
   render() {
    return (
      &lt;View&gt;        
        &lt;LoginButton
          publishPermissions={["publish_actions"]}
          onLoginFinished={
            (error, result) =&gt; {
              if (error) {
                alert("login has error: " + result.error);
              } else if (result.isCancelled) {
                alert("login is cancelled.");
              } else {
                AccessToken.getCurrentAccessToken().then(
                  (data) =&gt; {
                    alert(data.accessToken.toString())
                    console.log("lets try to sign in with provider")

                           firebase.auth().signInWithCredential(credential).catch(function(error) {
                            // Handle Errors here.
                                var errorCode = error.code;
                                var errorMessage = error.message;
                                console.log(errorMessage)
                                // ...
                              });




                  }
                )
              }
            }
          }
          onLogoutFinished={() =&gt; alert("logout.")}/&gt;
      &lt;/View&gt;
    );
  }
</code></pre>

<p>Right now it is saying that the provider variable I defined is <code>undefined</code>. I sit it towards the top with <code>const provider = firebase.auth.FacebookAuthProvider;</code></p>

<p>Is there a better way to approach this? I hope I am not alone.. Upon googling it dosen't really seem like too many other people are trying to do this.. just trying to get facebook auth on firebase to work with React Native</p>