Referral Deeplink of the installer Store

Overview

The In-App Referral feature enables users to seamlessly invite friends to install the app, enhancing user acquisition through personalized and shareable referral links.

Ensuring users are redirected to the original app store during referral programs or to leave ratings is crucial for a consistent user experience.

This guide provides you with essential information and code snippets needed to obtain the Referral Deeplink using the Android Billing SDK.

Description

This guide demonstrates the method to retrieve the Referral Deeplink.

Moving on to the implementation in your application, your first goal is to instantiate the client and connect to the Billing SDK. After retrieving the client, it can be used to execute the method.

So the implementation consists of 2 steps:

  1. Setup connection with Android Billing SDK;
  2. Request Referral Deeplink;

Step 1: Connect to the Android Billing SDK

For this, please follow the documentation in the Android Billing SDK - Setup Connection with Android Billing SDK .

Step 2: Request Referral Deeplink

To obtain the Referral Deeplink, execute the getReferralDeeplink() method which will retrieve a ReferralDeeplink . Process then the result received and use the data available in the ReferralDeeplink.

Do it following this approach:

private fun obtainReferralDeeplink() {
  val thread = Thread {
    val referralDeeplink = cab.referralDeeplink
    if (referralDeeplink.responseCode == ResponseCode.OK){
      // Referral Deeplink was retrieved successfully
    	...
    } else {
      // Failed to retrieve Referral Deeplink
      ...
    }
  }
  thread.start()
}
private void obtainReferralDeeplink() {
  Thread thread = new Thread(() -> {
    ReferralDeeplink referralDeeplink = cab.getReferralDeeplink();
    if (referralDeeplink.getResponseCode() == ResponseCode.OK){
      // Referral Deeplink was retrieved successfully
    	...
    } else {
      // Failed to retrieve Referral Deeplink
      ...
    }
  });
  thread.start();
}

StoreDeeplink

This parameter will retrieve the direct Deeplink to the installer Store. It can be an Android Native Deeplink or a Web Link.

FallbackDeeplink

This parameter will retrieve a Web Link pointing to the Aptoide Store.

If the device supports an Android native Deeplink, use the storeDeeplink parameter for better performance. In cases where no native support exists, fallback to the fallbackDeeplink, which points to the Aptoide Store.


Best Practices

Before requesting a ReferralDeeplink, ensure the device has active network connectivity. Use APIs like ConnectivityManager in Android to verify network status.
Handle exceptions and errors gracefully, providing fallback options or user guidance as necessary.