This is sample login code that uses react-native, redux, and firebase authentication. It is adapted from Stephen Grider's outstanding Udemy course The Complete React Native and Redux Course
git clone https://github.com/bobmacneal/react-native-firebase-auth.git
cd react-native-firebase-auth/login
npm install
will install dependencies.react-native run-ios
should bring up the app in the iOS simulator.- Once the app loads, login with test@gmail.com and pwd123! OR create a new account with any email and password.
If you want to adapt this code to your purposes, please create your own firebase project. Set up your project as follows:
- On the firebase console https://console.firebase.google.com/, set up new project.
- Click Authentication from navigation drawer, and click set up sign-in method. Enable the Email/Password sign-in provider.
- In upper top right, click web setup and copy the config part (not the script tags). Paste your instance config into src/App.js. For example:
var config = {
apiKey: "AIzaSyD24bKdgAwkzmiRE5EqSk69dU385crbS7w",
authDomain: "manager-cf894.firebaseapp.com",
databaseURL: "https://manager-cf894.firebaseio.com",
storageBucket: "manager-cf894.appspot.com",
messagingSenderId: "568410982736"
};
firebase.initializeApp(config);