DEVELOPER GUIDE
Integration with WhiteLabel

Integration WhiteLabel using App2App Flow

10min

Improve your mobile application's user experience with our App2App flow.

Using the App2App flow for WhiteLabel integration removes the jump between the app and the browser, and users only move between your app and the institution's app, providing users with a more native app experience, thereby increasing conversion rates.

Below we will walk you through the App2App flow and provide relevant implementation guidelines.

App2App Flow

The App2App flow is basically the same as the usually flow. The main difference is that after the user completes data sharing, the WhiteLabel authorization result is displayed in different places:

  1. In the usually flow, the user is redirected to the browser, and the WhiteLabel authorization result is displayed in the browser.
  2. In the App2App flow, the user will be redirected to your App, and the WhiteLabel authorization result will be displayed in the WebView of your App.

How your app can supports the App2App flow

To use the App2App flow, you need to make the following changes to your current implementation:

  1. Create an application link (we call it application_link) that can open your app.
  2. Use this application link to generate the URL address of the WhiteLabel.
  3. After redirecting to your app through the application link, open the WebView to display the WhiteLabel.

1. Create an Application Link to open your app

First, your App's needs to implement Universal Link (iOS) or App Links (Android).

If not, please follow the developer documentation below to develop:

Then create an appliction link that can open your app. After your users complete the data sharing authorization in the institution's app, redirect them to your app.

Why Custom URL Scheme is not recommended

When using a Custom URL Scheme to open your application, users will receive a pop-up message that they need to confirm before being redirected to your app, which can be a poor user experience.

By using Universal Link (iOS) or App Link (Android), users are automatically redirected to your app without needing to confirm the redirect.

2. Use Application Link to generate WhiteLabel URL

There are currently two options: Basic WhiteLabel and Advanced WhiteLabel

Basic WhiteLabel

1. Add application_link to your Basic WhiteLabel URL's parameters(For more parameter descriptions, please refer to the Basic WhiteLabel section).

Assuming that the URL of your Basic WhiteLabel is https://open-sandbox.klavi.ai/data/v1/basic-links/yourappid and application_link is https://your_application_app.com/link_callback, the full URL address of the WhiteLabel is as follows:

Curl


URL parameter values ​​need to be encoded

Please use encodeURIComponent to encode the parameter values ​​of redirect_url and application_link. For more information about encodeURIComponent, please refer to encodeURIComponent() - JavaScript | MDN

2. Then open this WhiteLabel full URL in your App's WebView so that your users can perform the data sharing flow.

Advance WhiteLabel

Call the createLink method and pass the applicationLink parameter (see the Advance WhiteLabel section for more details)

Curl


The request will return the following response, where linkURL is the URL of WhiteLabel

JSON


Open the linkURL in the WebView so that your users can proceed with the data sharing flow.

3. Display data sharing results in WebView

After users complete data sharing authorization in their institution's App, they will be redirected to the application_link to open your application. You need to read the link_callback_url parameter and open it in the WebView to display the results of this data sharing.

1. After users complete data sharing authorization in their institution's App, they will be redirected to the application_link address with the link_callback_url parameter, as shown below:

Curl


2. By redirecting application_link to redirect the user to your App, you need to read link_callback_url and open it in the WebView of the application. The link_callback_url address read in the example is as follows:

Curl


Once you implement this, users will be able to seamlessly go from your app, to the organization to authorize data sharing, and then back to your app.