Using Phone Auth as a sign-in methodįrom Firebase services, to use phone authentication as the sign-in method, you are going to enable the service from your Firebase project. Then, open Xcode adds this file to the project.įor Android users, you will download google-services.json and save it at the location android/app/.Īfter adding the config file, you’ll have to follow the react-native-firebase documentation instructions here. On the left side menu, click the settings icon, and then go to Project Settings.įrom there, click on the button Add app, select the appropriate platform, and follow the included instructions.ĭownload the file ist if your selected platform in the previous step is iOS. Next, add the details regarding this new Firebase project.Ĭlick the button Create project and you’ll be redirected to the dashboard screen. Once you’ve created a new account with Firebase and logged in, create a new project by clicking on the New Project button. To get started, you’re going to need a Firebase app. Then go back to the terminal window and execute the command below: cd ios/ Next, only for iOS devices and simulators, navigate to ios/Podfile and enter the following lines: pod 'Firebase/Core', '~> 6.3.0' To get started, the first dependency our demo app requires is the react-native-fireabase which is recommended by the Firebase team to work with when using Firebase SDK in React Native apps. So any library (such as react-native-firebase) that needs configuration set up to be platform-specific, please refer to their official docs. Lastly, the user can enter that value to sign in successfully.ĭo note that I’m going to use an iOS simulator for this tutorial. Once that’s confirmed, it sends the OTP to the mobile number user previously entered. The Firebase service then uses reCAPTCHA first to verify the user’s authenticity. When the user enters a number, they are sending a request an OTP from Firebase. There is a particular flow is followed when it comes to using the Phone sign-in method. To efficiently set up a backend service, let us use Firebase. In this tutorial, I am going to guide you through the process by demonstrating a login screen. Logging in a mobile app using the Phone number and a unique SMS verification code is one of the most common patterns to authenticate a user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |