TruecallerSdk class

Constructors

TruecallerSdk()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

getProfile → dynamic
After checking isUsable, you can show the Truecaller profile verification dialog anywhere in your app flow by calling the following method The result will be returned asynchronously via streamCallbackData stream
no setter
isUsable Future<bool?>
Once you initialise the Truecaller SDK using the initializeSDK method, and 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 whether the user has a valid account state or not by using the following method
no setter
setDarkTheme → dynamic
To customise the look and feel of the verification consent screen as per your app theme, add the following lines before calling the getProfile method. NOTE: It's not applicable for TruecallerSdkScope.CONSENT_MODE_BOTTOMSHEET
no setter
streamCallbackData Stream<TruecallerSdkCallback>?
Once you call getProfile, you can listen to this stream to determine the result of the action taken by the user. TruecallerSdkCallbackResult.success means the result is successful and you can now fetch the user's profile from TruecallerSdkCallback.profile TruecallerSdkCallbackResult.failure means the result is failure and you can now fetch the result of failure from TruecallerSdkCallback.error TruecallerSdkCallbackResult.verification will be returned only when using TruecallerSdkScope.SDK_OPTION_WITH_OTP which indicates to verify the user manually, so this is not applicable for flutter_truecaller_sdk 0.0.1
no setter

Static Methods

initializeSDK({required int sdkOptions, int consentMode = TruecallerSdkScope.CONSENT_MODE_BOTTOMSHEET, int consentTitleOptions = TruecallerSdkScope.SDK_CONSENT_TITLE_GET_STARTED, int footerType = TruecallerSdkScope.FOOTER_TYPE_SKIP, int loginTextPrefix = TruecallerSdkScope.LOGIN_TEXT_PREFIX_TO_GET_STARTED, int loginTextSuffix = TruecallerSdkScope.LOGIN_TEXT_SUFFIX_PLEASE_LOGIN, int ctaTextPrefix = TruecallerSdkScope.CTA_TEXT_PREFIX_USE, String privacyPolicyUrl = "", String termsOfServiceUrl = "", int buttonShapeOptions = TruecallerSdkScope.BUTTON_SHAPE_ROUNDED, int? buttonColor, int? buttonTextColor}) → dynamic
This method has to be called before anything else. It initializes the SDK with the customizable options which are all optional and have default values as set below in the method
requestVerification({required String phoneNumber, String countryISO = "IN"}) → dynamic
This method will initiate manual verification of phoneNumber asynchronously for Indian numbers only so that's why default countryISO is set to "IN". The result will be returned asynchronously via streamCallbackData stream Check TruecallerSdkCallbackResult to understand the different verifications states. This method may lead to verification with a SMS Code (OTP) or verification with a CALL, or if the user is already verified on the device, will get the call back as TruecallerSdkCallbackResult.verifiedBefore in streamCallbackData
setLocale(String locale) → dynamic
To customise the profile dialog in any of the supported Indian languages, add the following lines before calling the getProfile method with locale of your choice. NOTE: Default value is en
verifyMissedCall(String firstName, String lastName) → dynamic
Call this method after requestVerification to complete the verification if the number has to be verified with a missed call. i.e call this method only when you receive TruecallerSdkCallbackResult.missedCallReceived in streamCallbackData. To complete verification, it is mandatory to pass firstName and lastName of the user
verifyOtp(String firstName, String lastName, String otp) → dynamic
Call this method after requestVerification to complete the verification if the number has to be verified with an OTP. i.e call this method when you receive either TruecallerSdkCallbackResult.otpInitiated or TruecallerSdkCallbackResult.otpReceived in streamCallbackData. To complete verification, it is mandatory to pass firstName and lastName of the user with the otp code received over SMS