Deep Linking
Overview of how the SDK handles deep links and how to perform custom navigation within your application
Implementing URL Handling Callbacks
PushSDK.registerNotificationLifecycleCallbacks(object : PNNotificationLifecycleCallbacks {
// Add function overrides here
})PushSDK.registerNotificationLifecycleCallbacks(new PNNotificationLifecycleCallbacks() {
// Add function overrides here
});import com.pushly.android.PushSDK
import com.pushly.android.PushSDK.PNNotificationLifecycleCallbacks
import com.pushly.android.PushSDK.PNNotificationInteraction
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
PushSDK.logLevel = PNLogLevel.INFO
PushSDK.setConfiguration(appKey = "YOUR_APP_KEY", context = this)
PushSDK.PushNotifications.showPermissionPrompt(completion = { granted, response, error ->
error?.let {
println("Error encountered in permission request: $error")
return@showNativeNotificationPermissionPrompt
}
println("Permissions granted: $granted, response: $response")
})
PushSDK.registerNotificationLifecycleCallbacks(object : PNNotificationLifecycleCallbacks {
override fun onPushSDKDidReceiveNotificationDestination(
destination: String,
interaction: PNNotificationInteraction
): Boolean {
// Navigate to a activity within your application using the destination (the Landing URL)
// Return true to inform the SDK that it should not navigate
return true
}
})
}
}Notification Interaction Callbacks
Notification Opened With URI/URL Destination
Last updated