From 0f82ef575e835640f552d92a0ca406da0860925f Mon Sep 17 00:00:00 2001 From: "jeffrey n. carre" Date: Thu, 24 Dec 2020 09:40:22 -0500 Subject: [PATCH] Support Firebase email template Firebase email template for authentication does not url-encode the url part containing the appended parameters (code and mode). https://support.google.com/firebase/answer/7000714?authuser=1 Since it is a Firebase product and that in many use one would want to use the action link from the email as a deep link, i think it is a good idea to include these 2 parameters --- .../dynamiclinks/CapacitorFirebaseDynamicLinks.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/turnoutt/firebase/dynamiclinks/CapacitorFirebaseDynamicLinks.kt b/android/src/main/java/com/turnoutt/firebase/dynamiclinks/CapacitorFirebaseDynamicLinks.kt index cb9931c..404601b 100644 --- a/android/src/main/java/com/turnoutt/firebase/dynamiclinks/CapacitorFirebaseDynamicLinks.kt +++ b/android/src/main/java/com/turnoutt/firebase/dynamiclinks/CapacitorFirebaseDynamicLinks.kt @@ -194,6 +194,17 @@ class CapacitorFirebaseDynamicLinks : Plugin() { } if (deepLink != null) { val ret = JSObject() + + val intentData: Uri? = intent.data + if (intentData != null) { + val code: String = intentData.getQueryParameter("oobCode").orEmpty() + val mode: String = intentData.getQueryParameter("mode").orEmpty() + val parameter: String = intentData.toString() + ret.put("code", code) + ret.put("mode", mode) + ret.put("parameter", parameter) + } + ret.put("url", deepLink.toString()) notifyListeners(EVENT_DEEP_LINK, ret, true) } @@ -204,4 +215,4 @@ class CapacitorFirebaseDynamicLinks : Plugin() { companion object { private const val EVENT_DEEP_LINK = "deepLinkOpen" } -} \ No newline at end of file +}