Menu

Deep Linking

       Deep links are used to send users directly to specific in-app locations, producing a seamless user journey and improving conversion rates. This chapter will introduce necessary steps to generate deep links in SolarEngine.

1. Build URI Scheme

       If a user already has your app installed and clicks on your deep link, SolarEngine SDK will open your app, parse the deep link information, and direct users to the page where you wanted them to land. To set up a deep link, you'll need to define a unique URI scheme.

1.1. Configure AndroidManifest.xml

       If you want to navigate your users to an activity within your app, you can follow the steps below:

1. Define a unique scheme name for your activity in your app's AndroidManifest.xml file.

2. Add an intent-filter for your activity.

3. Add an android:scheme in your intent-filter.

       Here is an example code snippet defining the activity name as "MainActivity" and scheme name as "sedemo" in the AndroidManifest.xml file.

<activity
       android:name=".activity.MainActivity">
       <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
         <data android:scheme="sedemo" />
     </intent-filter>
</activity>

       If a user clicks on the following example link, which includes your specified scheme name and follows the accepted URL Scheme protocol format of scheme://yourhost:port/path, the activity will be triggered.

Example:

       sedemo://lionmobo.com/goods_detail?param1=value1¶m2=value2

1.2. Retrieve Deep Link Info

       To extract the deep link information from the activity's intent, you can call the getData() method within the onCreate() or onNewIntent() method when the app starts.

Example 1: onNewIntent()

@Override
protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);

   Uri data = intent.getData();
   // data.toString() -> deeplink information.
}

Example 2: onCreate()

@Override
protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);

   Intent intent = getIntent();
   Uri data = intent.getData();
   // data.toString() -> deeplink information.
}

2. Set up App Links

       App Links are a special deep link that allows for seamless linking between mobile apps and websites. When a user clicks on a link on the website, App Links facilitates direct opening of the associated app without presenting a a selection dialog for the user to decide which app to use. Another benefit is that it can avoid the problem of duplication that can occur with traditional URL schemes. But this method cannot be called in browsers.

2.1. Check assetlinks.json

       To verify the association between your app and your website, you can check if the assetlinks.json file can be downloaded successfully from your website by typing the URL https://{domain}/.well-known/assetlinks.json in a web browser.

       Please replace "domain" as the one you input on SolarEngine platform, such as tlink.solar-engine.com.

       Entry: Attribution - Retargeting Attribution Settings - Configure App Links - Subdomain

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "The package name of your app",
    "sha256_cert_fingerprints":
    ["The sha256_cert_fingerprints of your app"]
  }
}]

2.2. Configure AndroidManifest.xml

<activity
            android:name=".activity.SplashActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data
                    android:scheme="https"
                    android:host="The subdomain you set on SE"
                    android:pathPattern="The path you set on SE" />
            </intent-filter>
 </activity>

3. Re-Attribution via Deep Links

       To re-attribute users, please call the appDeeplinkOpenURI method in SolarEngine SDK when your app receives the deep link content. Then our SDK will extract the re-attribution information from the deep link and send this information to our server for re-attribution.

Function

public void appDeeplinkOpenURI(Uri uri);

Sample Code

@Override
protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);

   Uri data = intent.getData();
   if(data != null) {
      SolarEngineManager.getInstance().appDeeplinkOpenURI(data);
   }
}

4. Set Deep Link Callback

Function

setDeepLinkCallback(DeepLinkCallBack callback);

Sample Code  (You need to call this method before initializing the SDK)

SolarEngineManager.getInstance().setDeepLinkCallback(new DeepLinkCallBack() {
            @Override
            public void onReceived(int code, DeeplinkInfo deeplinkInfo) {
                if(code == 0){
                    // Process deep link callback success
                }
            }
});
//SDK  initiate ...

DeeplinkInfo Parameters Explanation

ParameterDescriptionType
sedpLinkredirection parametersString
turlId7-bit tracking URLString
fromlink typeString
customParamscustom parametersMap<String,Object>

ErrorCode Explanation

error codeerror reason
0Success
1Blank URL
2Illegal URL

5. Report Deep Link Invocation Success Event

       Developers can report the deep link successful invocation event for further user re-engagement analysis.

Function

public synchronized void trackAppReEngagement(SEAppReEngagementModel seAppReEngagementModel);

Sample Code

SolarEngineManager.getInstance().trackAppReEngagement(new SEAppReEngagementModel());


Previous
Native App & H5 Connection
Next
Deferred Deep Linking
Last modified: 2025-02-26Powered by