# Initialisation

6\. Create a TruecallerSdkScope object by using the appropriate configurational settings and use it to initialise the TruecallerSDK in your android activity's onCreate method :

Copy

```
TruecallerSdkScope trueScope = new TruecallerSdkScope.Builder(this, sdkCallback)
        .consentMode(TruecallerSdkScope.CONSENT_MODE_BOTTOMSHEET)
        .buttonColor(Color.parseColor(colorSpinner.getSelectedItem().toString()))
        .buttonTextColor(Color.parseColor(colorTextSpinner.getSelectedItem().toString()))
        .loginTextPrefix(TruecallerSdkScope.LOGIN_TEXT_PREFIX_TO_GET_STARTED)
        .loginTextSuffix(TruecallerSdkScope.LOGIN_TEXT_SUFFIX_PLEASE_VERIFY_MOBILE_NO)
        .ctaTextPrefix(TruecallerSdkScope.CTA_TEXT_PREFIX_USE)
        .buttonShapeOptions(TruecallerSdkScope.BUTTON_SHAPE_ROUNDED)
        .privacyPolicyUrl("<<YOUR_PRIVACY_POLICY_LINK>>")
        .termsOfServiceUrl("<<YOUR_PRIVACY_POLICY_LINK>>")
        .footerType(TruecallerSdkScope.FOOTER_TYPE_NONE)
        .consentTitleOption(TruecallerSdkScope.SDK_CONSENT_TITLE_LOG_IN)
        .sdkOptions(TruecallerSdkScope.SDK_OPTION_WITHOUT_OTP)
.build();          

TruecallerSDK.init(trueScope);
```

You will find complete details on the configuration options in the TruecallerSdkScope object as described above, and all the possible available values in the immediate next section of this documentation [here](https://docs.truecaller.com/truecaller-sdk/android/sdk-v2.8.0/integrating-with-your-app/customisation-1).

{% hint style="info" %}
Here, ***sdkCallback*** is an interface that you need to define in your app where you would get the success or failure callbacks. You will find details about the implementation in this [section](https://docs.truecaller.com/truecaller-sdk/android/sdk-v2.8.0-deprecating-soon/integrating-with-your-app/implement-callbacks).

Please note, ***sdkOptions*** enables you to configure the verification capability of Truecaller SDK. If you want to use the SDK for verification of Truecaller users only, you should provide the scope value as *TruecallerSdkScope.SDK\_OPTION\_WITHOUT\_OTP*

If you want to use the SDK for verification of Truecaller users as well as non-Truecaller users powered by Truecaller's drop call / OTP ( for implementation details, refer [Verifying non-Truecaller users](https://docs.truecaller.com/truecaller-sdk/android/sdk-v2.8.0-deprecating-soon/integrating-with-your-app/verifying-non-truecaller-users) section ), you should provide the scope value as *TruecallerSdkScope.SDK\_OPTION\_WITH\_OTP*
{% endhint %}

Truecaller SDK needs to be initialised only once and the same instance can be accessed at any place within your app, without the need to initialise it again, via `TruecallerSDK.getInstance()`<br>

{% hint style="info" %}
Initialising the SDK at more than one place can lead to undesired behaviour
{% endhint %}

Once you initialise the TruecallerSDK using the init() method, if you are using the SDK for verification of only Truecaller users ( by setting the *sdkOptions* scope as TruecallerSdkScope.SDK\_OPTION\_WITHOUT\_OTP ), you can check if the Truecaller app is present on the user's device or not by using the following method

Copy

```
TruecallerSDK.getInstance().isUsable()
```

<figure><img src="https://3916632365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJzE3kcOEptTlnx7Hgg25%2Fuploads%2FVF2O5rPyB5VwflC8e4Th%2F1.webp?alt=media&#x26;token=06c0464f-154d-4126-8c17-efe4cd25aec3" alt=""><figcaption></figcaption></figure>

You can trigger the Truecaller profile verification dialog anywhere in your app flow by calling the following method

Copy

```
TruecallerSDK.getInstance().getUserProfile() 
```

<figure><img src="https://3916632365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJzE3kcOEptTlnx7Hgg25%2Fuploads%2FDt1PJ8OnAaNEiuflNIh4%2F2.avif?alt=media&#x26;token=ba314e66-6aab-4151-80cc-a8053ffc3a28" alt=""><figcaption></figcaption></figure>

You can trigger the Truecaller profile verification dialog anywhere in your app flow by calling the following method

Copy

```
TruecallerSDK.getInstance().getUserProfile() 
```

<figure><img src="https://3916632365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJzE3kcOEptTlnx7Hgg25%2Fuploads%2F1C74ORr22wE9nfumYDDQ%2F2.avif?alt=media&#x26;token=7b3339bf-ce2d-42b6-b2a6-8a4314abba5d" alt=""><figcaption></figcaption></figure>

In case **isUsable()** method returns false, implying that Truecaller app is not present on the device, you can take the user to your app screen and continue with the [verification flow for non-Truecaller users](https://docs.truecaller.com/truecaller-sdk/android/sdk-v2.8.0-deprecating-soon/integrating-with-your-app/verifying-non-truecaller-users) OR choose to use your own verification flow \[ Refer image below ].

<figure><img src="https://3916632365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJzE3kcOEptTlnx7Hgg25%2Fuploads%2FNdgNytfiBQQNhlbDPoUk%2F3.avif?alt=media&#x26;token=2e41eae1-3f07-4b8a-952e-217e266b31d4" alt=""><figcaption></figcaption></figure>
