Truecaller for Developers
  • Hello!
  • Why Truecaller SDK?
  • Getting Started
  • Android
    • OAuth SDK 3.1.0
      • Implementing user flow for your App
      • Scenarios for all user verifications : Truecaller and Non Truecaller Users
      • Integration Steps
        • Generating Client ID
        • Setup
        • Implementing Callbacks
        • Initialisation
        • Setting up OAuth parameters
        • Invocation
        • Customisation
        • Clearing SDK Instance
        • Handling Error Scenarios
        • Integrating with your Backend
          • Fetching User Token
          • Fetching User Profile
        • Non Truecaller User Verification
          • Completing Verification
          • TrueException
          • Server Side Validation
      • Instrumentation
      • Getting Release Ready
        • Testing your verification flow
          • Non-Truecaller user verification flow
          • Truecaller user verification flow
          • Test Setup
        • Google play store app permission declaration form
        • Moving to Production
    • OAuth SDK 3.0.0
      • Implementing user flow for your App
      • Scenarios for all user verifications : Truecaller and Non Truecaller Users
      • Integration Steps
        • Generating Client ID
        • Setup
        • Implementing Callbacks
        • Initialisation
        • Setting up OAuth parameters
        • Invocation
        • Customisation
        • Clearing SDK Instance
        • Handling Error Scenarios
        • Integrating with your Backend
          • Fetching User Token
          • Fetching User Profile
        • Non Truecaller User Verification
          • Completing Verification
          • TrueException
          • Server Side Validation
      • Instrumentation
      • Getting Release Ready
        • Testing your verification flow
          • Non-Truecaller user verification flow
          • Truecaller user verification flow
          • Test Setup
        • Google play store app permission declaration form
        • Moving to Production
    • SDK v2.8.0[Deprecating Soon ⚠️]
      • Implementing user flow for your app
      • Scenarios for all user verifications : Truecaller and Non Truecaller Users
      • Generating App Key
      • Integrating with your App
        • Setup
        • App Key Configuration
        • Initialisation
        • Customisation
        • Implement Callbacks
        • Clearing SDK instance
        • Handling Error Scenarios
        • Verifying non Truecaller users
          • TrueException
          • Completing Verification
        • Advanced Steps
      • Server Side Response Validation
        • For Truecaller users verification flow
        • For Non-Truecaller users verification flow
      • Instrumentation
      • Getting Release Ready
        • Testing your verification flow
          • Truecaller user verification flow
          • Non-Truecaller User Verification Flow
          • Test Setup
        • Google Play App Signing
        • Google Play Store app permissions declaration
        • Google Play Policy Change for Device Identifiers
      • Changelog
    • Change Log
  • Mobile Websites
    • Implementing user flow for your Mobile Website
    • Generating App Key
    • Integrating with your mobile website
      • Initialisation
      • Invoking verification
      • Fetch User Profile
      • Completing User Verification
      • Handling Error Scenarios
    • Getting Release Ready
      • Instrumentation
      • Testing your verification flow
  • iOS
    • Generating App Key
    • Integrating with your iOS App
      • Setup
      • Configuration
      • Usage
        • Swift
        • Objective-C
      • Verifying Non-Truecaller app users
        • Completing Verification
      • Handling Error Scenarios
        • Safari Redirection
    • Server Side Response Validation
  • Shopify App
    • Generating App Key
    • App Configuration
    • Deactivating App Block
  • FAQS
    • General
    • Developer Account
    • Android App SDK
    • Android OAuth SDK
    • Mobile Web SDK
    • Number Verification Plugin
  • Product Updates
    • App Review Process
    • Introducing dark theme
Powered by GitBook
On this page
Export as PDF
  1. Android
  2. SDK v2.8.0[Deprecating Soon ⚠️]
  3. Integrating with your App

Handling Error Scenarios

Failure/ Error responses

The "onFailureProfileShared" callback method that you just implemented in the previous step helps you to handle all the possible failure cases when the user couldn't be verified successfully via the Truecaller flow.

Below are some of the possible failure scenarios and the corresponding error response that you receive for each of the cases :

Error Code

What it means

1

Network Failure

2

User pressed back

3

Incorrect Partner Key

4 & 10

User not Verified on Truecaller*

5

Truecaller App Internal Error

13

User pressed back while verification in process

14

User pressed footer CTA (" USE ANOTHER NUMBER")

15

To handle ActivityNotFound Exception, in case Truecaller app fails to initiate

*Error Type 4 and Error Type 10 could arise in different conditions depending on whether the user has not registered on Truecaller app on their smartphone or if the user has deactivated their Truecaller profile at any point of time from the app.

Apart from the above mentioned error cases, there are few other error scenarios that you may encounter under rare circumstances. For complete and exhaustive list of all the error cases, you can refer to TrueError.class within the SDK.

Please note that when you encounter any of the error scenarios and get the control in the "onFailureProfileShared()" method, you should redirect the user to your alternate verification flow.

Exceptions

In case you face any of the following run time exceptions, please follow the recommended steps as mentioned below :

"No compatible client available. Please change your scope"

As the exception suggests, you are trying to call an SDK method even though no client is available to handle it. This usually happens if you have initialised the SDK using WITHOUT_OTP scope option i.e to verify only the Truecaller users, and you are not calling isUsable() method before calling an SDK method. To resolve this, call isUsable() before calling any SDK method if you are using WITHOUT_OTP scope option

"Please call init() on TruecallerSDK first"

This exception suggests that you are trying to call an SDK method before the SDK has been initialised. To resolve it, check for all possible user flows in your app which could lead to calling an SDK method directly before it has been initialised.

PreviousClearing SDK instanceNextVerifying non Truecaller users

Last updated 11 months ago