Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document describes how to handling deep links with push notifications. For information on deep linking with In-App, see Inbox and In-App Action Handling for Android (Mapp Cloud)

Currently, our SDK does not support custom URI deep links. The SDK currently requires a standardized URI to encode the deep link. When enabling deep linking within the mobile app, include the configuration for the project manifest and java function. When the marketer specifies which deep link to use in Mapp Engage, they need to include the syntax APX://open=deeplink

Deeplink:

The configuration of the project manifest.

Code Block
languagexml
<activity android:name=".DeepLinkActivity">
	<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"/>
		<category android:name="${applicationId}" />  //mandatory for Android FCM SDK v6.0.9 and later
	</intent-filter>
</activity>

...

Example for Compose application with ComponentActivity, how can handle DEEPLINK from push message.

Code Block

class DeepLinkActivity : ComponentActivity() {
    private val APX_LAUNCH_DEEPLINK_ACTION = "com.appoxee.VIEW_DEEPLINK"


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)


        setContent {
            val data = remember { mutableStateListOf<String>("Test data") }

             Body(data = data)


            LaunchedEffect(key1 = Unit) {
                if (APX_LAUNCH_DEEPLINK_ACTION == intent.action) {
                    intent.data?.let {
                        data.clear()
                        val link = it.getQueryParameter("link") ?: ""
                        val messageId: String = it.getQueryParameter("message_id") ?: ""
                        val eventTrigger: String = it.getQueryParameter("event_trigger") ?: ""
                        data.add(link)
                        data.add(messageId)
                        data.add(eventTrigger)
                    }
                }
            }
        }
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun Body(data: List<String>) {
    TestCoopTheme() {
        Surface(
            modifier = Modifier
                .fillMaxSize()
        ) {
            LazyColumn(
                modifier = Modifier
                    .fillMaxSize()
                    .padding(10.dp),
            ) {
                items(data) {
                    Text(it)
                }
            }
        }
    }
}

...