Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The following is the basic procedure for incorporating Truecaller SDK with Firebase Phone Authentication in Android:

  1. First, you need to create a Firebase project and enable Phone authentication. Follow the instructions on the Firebase website to set up and configure your Firebase project.

  2. Next, you need to integrate the Truecaller SDK into your Android application. The SDK can be downloaded from the Truecaller website.

  3. After you have downloaded the Truecaller SDK, add it as a dependency in your app-level Gradle file.

  4. In your app's MainActivity file, initialize the Truecaller SDK by calling the TruecallerSdk.init() method. You'll need to pass in your Truecaller partner key and partner secret as parameters.

  5. To use Truecaller for phone number verification, you'll need to add a button to your login screen that triggers the Truecaller login process. When the user taps the button, you'll need to create a TruecallerParams object, set the relevant properties such as the requestNonce, and call the TruecallerSDK.getInstance().requestVerificationChallenge() method.

  6. When the user completes the Truecaller verification process, you'll receive a response in the TruecallerSdkCallback.onSuccess() method. In the onSuccess() method, you'll need to parse the result and use the Firebase Phone Auth API to authenticate the user with their phone number.

  7. To complete the authentication process, call the Firebase PhoneAuthCredential object’s verificationId and verificationCode methods for verifying the user.

That’s it! You have successfully integrated Truecaller SDK with Firebase Phone Authentication in your Android app.