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. iOS
  2. Integrating with your iOS App
  3. Handling Error Scenarios

Safari Redirection

PreviousHandling Error ScenariosNextServer Side Response Validation

Last updated 11 months ago

Please refer to this section in case you face issues during the app redirection from your app to Truecaller app or vice versa, during the verification flow.

Truecaller SDK uses to handle the redirection between Truecaller app and your app. The process involves 4 steps, as defined below :

  1. User taps the “Sign up with Truecaller” option on your app

  2. Universal link opens Truecaller app

  3. User taps “Continue” button on the Truecaller verification screenD. Universal links opens your app

How Universal Links works

Associated domains are used to notify the OS that these are the universal links supported by Truecaller SDK.

On tapping a URL or when the app calls openURL request, the OS will check if any of those apps have an associated domain related to the URL which is being opened.

If there is one, the OS tries to check for AASA ( apple-app-site-association ) files related to the domain and if the file consists of the path, it opens the app and transfers control to the app.

If any of the above is missing ( the AASA or the path), it will redirect the url to Safari.

What are associated domains

We need to host a file named AASA ( apple-app-site-association ), which has all the URLs or URL extensions, which can be used to open the app.

For example: If you have your app named "xyz" and you need to open your app on tapping a url , you need to host an AASA file under the url .

Example of a sample AASA File to open your app for URL:

We already cover the steps for creating and hosting the AASA file for you on registering your app in truecallerdevs.com.

You can check if the AASA for your app is available at: YOUR_APPLINK( provided by Truecaller )/.well-known/apple-app-site-association

How is the OS is notified about Associated Domains

The OS on first installation of your app will try hitting these URLs for ./well-known/apple-app-site-association endpoints and if there is a file at the endpoint, it is downloaded to the OS. If the file is downloaded without any error, all the urls you specified will take the user to the app and if not, you will be redirected to Safari browser as if trying to open a normal URL. If there is an error in downloading the AASA file, we as the SDK or your app will not be manually able to download the file and hence it will keep on redirecting to safari. There is a three hour window of retry for AASA files depending on different status codes, that is the OS will retry downloading the AASA file after 3 hours and if it succeeds, all the redirections to your app works properly.

What to do if you face the safari redirection issue while testing the Truecaller iOS SDK integration with your app ?

If you encounter the safari redirection issue while integrating the Truecaller SDK with your iOS app, that probably means there’s some issue in downloading the AASA file for either your application or for the Truecaller app on your device. In such a scenario, you should try uninstalling and reinstalling your app build as well as Truecaller app from the device you are testing on, and re-try the flow after sometime. Usually, it may take a few hours ( as mentioned in the above section ) for the retry mechanism to kick in and download the updated AASA file on the device. Once that is successful, the flow should work absolutely fine.

It should look like: P.S : change the italic part to your app link.

Apple documentation on associated domains can be found . Once you enable the associated domain capability for your app id, you can add associated domains entitlements with the necessary app links and web credentials. This is one of the steps in Truecaller SDK integration.

https://si44524554ef8e45b5aa83ced4e96d5xxx.truecallerdevs.com/.well-known/apple-app-site-association
here
universal links
https://xyz.com/register
https://xyz.com/apple-app-site-association
https://xyz.com/register