Firebase OTP Configuration #
To configure OTP in Firebase, you must first create a Firebase project. If you haven’t created any project for your application yet, please follow the instructions given here.
To enable OTP functionality via Firebase, please ensure that you have added a billing account to your Firebase project. Without an active billing account, some Firebase services, such as OTP and Cloud Functions, may not work as expected.
Now go to the Firebase console and follow the instructions below-
Adding sign-in method #
- Go to your Firebase project.
- Navigate to the Build menu from the left sidebar and select Authentication.
- Get started on the project and go to the Sign-in method tab.
- From the Sign-in Providers section, select the Phone option.
- Ensure to enable the method Phone and press save
- Add Sha1 and Sha256 key in your project app
7. Select Region for which country you want to send otp.
Admin Panel Configuration #
To configure the Admin panel for Firebase OTP verification, follow these steps:
- Go to your Firebase project.
- In the Project settings, locate your Web API Key and make a copy of it.
- Go to the Admin panel.
- Navigate to the Configurations section.
- Select 3rd Party.
- Choose Firebase OTP.
- Paste the Web API Key copied from your Firebase project.
- Turn on the Firebase OTP Verification Status.
App Configuration # #
To configure the app, follow the steps below-
- Go to the Project settings > General > Your apps.
- Download the google-services.json file for Android and the GoogleService-Info.plist for the IOS app.
Copy that file and paste it under <project>/android/app/ folder for Android and under <project>/iOS/ for IOS.
For Ios :
- Go to the info.plist file
- Please replace the marked code in your Info.plist file with your REVERSED_CLIENT_ID, which can be found in the GoogleService-Info.plist file. This ensures that Firebase is correctly configured for your iOS application.