Skip to content

Commit 30e4633

Browse files
committed
fix(deeplink): properly parse out jump and auto verify
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent e25a52f commit 30e4633

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@
128128
android:scheme="https" />
129129
</intent-filter>
130130

131-
<intent-filter>
131+
<intent-filter android:autoVerify="true">
132132
<action android:name="android.intent.action.VIEW" />
133133

134134
<category android:name="android.intent.category.DEFAULT" />
135135
<category android:name="android.intent.category.BROWSABLE" />
136136

137137
<data
138-
android:host="jump.getcode.com"
138+
android:host="@string/root_url_jump_no_protocol"
139139
android:scheme="https" />
140140
</intent-filter>
141141

app/src/main/java/com/getcode/util/DeeplinkHandler.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class DeeplinkHandler @Inject constructor(
7171

7272
// check for jump
7373
if (uri.host == context.getString(R.string.root_url_jump_no_protocol)) {
74-
val source = uri.getQueryParameter("source")
74+
val regex = "#source=([^&]*)".toRegex()
75+
val source = regex.find(uri.toString())?.groupValues?.get(1)
7576
if (source != null) {
7677
uri = Uri.parse(source)
7778
}

0 commit comments

Comments
 (0)