From 7cfe4846c01b42788f859e038d9a4e08035e0154 Mon Sep 17 00:00:00 2001 From: rikardwissing Date: Tue, 25 Feb 2020 22:24:44 +0100 Subject: [PATCH] Add deep linking support --- .../reporting/OpenNotificationActivity.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pushnotifications/src/main/java/com/pusher/pushnotifications/reporting/OpenNotificationActivity.kt b/pushnotifications/src/main/java/com/pusher/pushnotifications/reporting/OpenNotificationActivity.kt index 10911df8..cbf9e5d4 100644 --- a/pushnotifications/src/main/java/com/pusher/pushnotifications/reporting/OpenNotificationActivity.kt +++ b/pushnotifications/src/main/java/com/pusher/pushnotifications/reporting/OpenNotificationActivity.kt @@ -2,6 +2,7 @@ package com.pusher.pushnotifications.reporting import android.app.Activity import android.content.Intent +import android.net.Uri import android.os.Bundle import com.firebase.jobdispatcher.* import com.google.gson.Gson @@ -30,6 +31,15 @@ class OpenNotificationActivity: Activity() { i.replaceExtras(bundle) + val link: String + + link = i.getStringExtra("link") + + if(link != null) { + log.i("Got URI for action $link") + i.setData(Uri.parse(link)) + } + // We need to clear the activity stack so that this activity doesn't show up when customers // are debugging. i.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP