Truecaller SDK
  • Hello!
  • Why Truecaller SDK
  • Getting Started
  • ANDROID
    • 🆕OAuth SDK 3.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
      • 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
  • 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

Was this helpful?

  1. ANDROID
  2. OAuth SDK 3.0
  3. Integration Steps

Handling Error Scenarios

Failure/ Error responses

The "onFailure" 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 Description
Error Code

"Something went wrong"

0

"Device is not supported"

16

"Truecaller user has an invalid account state"

10

"Invalid partner or partner information is missing"

12

"Conflicting request code possible in onActivityResult()"

6

"Truecaller app closed unexpectedly"

7

"Truecaller app is not installed/loggedin"

5

"User denied by pressing the footer button"

11

"User denied by dismissing consent screen"

14

"User denied while loading"

2

"Truecaller sdk is old and not compatible"

6

Please note that when you encounter any of the error scenarios and get the control in the "onFailure()" 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 initialized the SDK using ONLY_TC_USERS scope option i.e to verify only the Truecaller users, and you are not calling isOAuthFlowUsable() method before calling an SDK method. To resolve this, call isOAuthFlowUsable() before calling any SDK method if you are using VERIFY_TC_USERS 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.

"Add client id in your manifest"

This exception suggests that you are trying to call SDK initialization/build method without having your clientID mentioned in your manifest as meta-data.

"OAuth scopes cannot be null or empty"

This exception suggests that you are trying to call SDK method - getAuthorisationCode before setting up the OAuth scopes

"OAuth state cannot be null or empty"

This exception suggests that you are trying to call SDK method - getAuthorisationCode before setting up the OAuth state

“Code challenge cannot be null or empty”

This exception suggests that you are trying to call SDK method - getAuthorisationCode before setting up the Code challenge

PreviousClearing SDK InstanceNextIntegrating with your Backend

Last updated 1 year ago

Was this helpful?

🆕