Android Inbox and In-App Action Handling

Prev Next

Overview

This document explains how the Android SDK handles different types of actions triggered by In-App Messages and Inbox or Push Notifications.

Supported Action Types

The SDK supports the following six types of actions:

  1. Dismiss: Available only for In-App Messages (Full Screen, Modal, or Banner). It allows users to dismiss the message quickly.

  2. App Store: Opens the Google Play Store to the specified app using its <package_name>.

  3. Open Landing Page: Opens a URL either:

    • Inside the SDK’s built-in Landing Page viewer, or

    • In the device’s default browser (e.g., Chrome on Android).

  4. Deep Link: Opens a predefined destination within your app.

  5. Custom Link: Supports app-specific logic triggered by a custom URL.

  6. Inbox Deep Link in Push Message: Directs the user to a specific inbox message inside your app.


Intent Filters for Deeplink Handling

To handle these actions, define the following intent-filter configurations in your AndroidManifest.xml file.

1. Deep Link

<intent-filter>
    <data android:scheme="apx" />
    <data android:host="deeplink" />
    <action android:name="com.appoxee.VIEW_DEEPLINK" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

2. Custom Link

<intent-filter>
    <data android:scheme="apx"/>
    <data android:host="custom"/>
    <action android:name="com.appoxee.VIEW_CUSTOM_LINKS"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>

3. Inbox Deep Link

<intent-filter>
    <data android:scheme="apx"/>
    <data android:host="inbox"/>
    <action android:name="com.appoxee.VIEW_INBOX"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>

Handling Deep Links in Your Activity

To respond to these deep links in your activity, retrieve the Uri from the Intent and take the appropriate action.

Example Java Code

Uri uri = null;
if (getIntent() != null) {
    if (APX_LAUNCH_DEEPLINK_ACTION.equals(getIntent().getAction())) {
        //Can be APX_LAUNCH_DEEPLINK_ACTION or APX_LAUNCH_CUSTOM_ACTION or APX_LAUNCH_INBOX_ACTION
        uri = getIntent().getData();
        if(uri != null) {
            openDeepLink(uri);
        }
    }
}

private void openDeepLink(Uri uri) {
    String deeplinkValue = uri.getQueryParameter("link");
    String mesageId = uri.getQueryParameter("message_id");
    //This is the eventTrigger only for version 5.0.7 and higher
    String eventTrigger = uri.getQueryParameter("event_trigger");
    if(deeplinkValue.equalsIgnoreCase("yourString")) {
    //do your work here
    }
    if(!TextUtils.isEmpty(mesageId )) {
    //You received some message id corresponding to some inbox message
    }
}