Skip to main content
Version: 1.0

2.1.1.2 Deep Link Method

The Deep Link Verification process allows users to verify their phone numbers by interacting with an external application, such as Telegram or WhatsApp, and then returning to your app to complete the verification.

Get started

  • Setup Requirements: Follow the basic setup instructions.
  • iOS Configuration: If using the deep link method, add LSApplicationQueriesSchemes to your app’s ios/Info.plist to enable external app linking.
xml
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tg</string>
<string>whatsapp</string>
</array>

Initializing VerifySpeed

To start, initialize an instance of DeepLinkProcessor:

  • redirectToStore (optional): Set true (default) to redirect users to the app store if Telegram or WhatsApp is not installed.
dart
  final deepLinkProcessor = VerifySpeed.instance.initializeDeepLinkProcessor(redirectToStore: true); 

Use verifyPhoneNumberWithDeepLink with these parameters:

  • deepLink: URL that directs users to the external app for verification.
  • verificationKey: Unique key provided by your backend to ensure verification integrity.
  • onSuccess: Callback triggered on successful verification, returning a token to retrieve the user’s phone number.
  • onFailure: Callback triggered if verification fails, providing error details including type and message.
dart
    await deepLinkProcessor.verifyPhoneNumberWithDeepLink(
deepLink: 'DEEP_LINK', // deep link provided by your backend
verificationKey: 'VERIFICATION_KEY', // unique key provided by your backend
onSuccess: (token) {
log('token: $token');
},
onFailure: (error) {
log('error: ${error.message} type: ${error.type}');
},
);

Handling App Resumption

When users return from the external app, call notifyResumed to complete the verification process and receive the token from the onSuccess callback.

dart
    await deepLinkProcessor.notifyResumed();

Example

For a complete implementation, see the example project on GitHub, and deep link section for more details.

tip

When testing the example project, you'll need to integrate with your backend using these recommended request/response structures (which you can modify as needed).

tip

Search for keywords TIP if you want to know how to implement Deep Link Verification.