Redux Firebase and React Navigation React Native Auth Flow
This example contains basic phone auth (Firebase) flow with the following:
redux react-navigation react-native-firebase
Clone the repo git clone [email protected]:gkartalis/react-native-phone-auth-firebase.git
cd react-native-phone-auth-firebase
npm i
or yarn
Connect your firebase project to the repo:
go to Firebase Console
select Add project and create your project.
Select your project and click Authentication option on your left
From the upper tab select sign-in method and then click Phone and enable it.
In order to use phone login via emulators choose Phone numbers for testing and add a phone number and a verification code and click add.
Go to project settings and in General tab click Add firebase to your iOS app or/and Add firebase to your Android App and complete the form.
Download the config file (google-services.json for android) and (GoogleService-Info.plist for iOS)
Move the GoogleService-Info.plist file you just downloaded into the root of your Xcode project and add it to all targets.
Move the google-services.json file you just downloaded into the androd/app of your android project.
Open the project with XCode, Clean it and Build it. Then run yarn ios
or react-native run-ios
Open the android project with Android Studio. Select Build > Clean Project. Then run yarn android
or react-native run-android
Open XCode go to Plist and add URL types: * Document Role : editor * URL Identifier: your.package.name * URL Schemes * Item 0 : REVERSED_CLIENT_ID * You can find REVERSED_CLIENT_ID inside the GoogleService-Info.plist
Initial setup:
https://rnfirebase.io/docs/v4.3.x/installation/initial-setup