Initialisation

6. Create a TrueSdkScope object by using the appropriate configurational settings and use it to initialize the TrueSDK in your android activity's onCreate method:

TrueSdkScope trueScope = new TrueSdkScope.Builder(this, sdkCallback)
.consentMode(TrueSdkScope.CONSENT_MODE_FULLSCREEN )
.consentTitleOption( TrueSdkScope.SDK_CONSENT_TITLE_VERIFY )
.footerType( TrueSdkScope.FOOTER_TYPE_SKIP )
.build();
TrueSDK.init(trueScope);

Once you initialise the TrueSDK using the init() method, you can check whether the SDK can be used or not by using the following method :

TrueSDK.getInstance().isUsable()

When Truecaller is present on the device and SDK can be used, isUsable() method will return 'true'. You can then trigger the Truecaller profile verification dialog anywhere in your app flow by calling the following method

TrueSDK.getInstance().getUserProfile()

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 your own verification flow [ Refer image below ]