From 308a640b1fb507b5013791ec1cb40e8c545619de Mon Sep 17 00:00:00 2001 From: Pranavkumar Patel Date: Sat, 3 Oct 2026 21:12:39 -0400 Subject: [PATCH] Let a browser hand a geo link to the app The geo filter had no BROWSABLE category, so another app's "open location" reached the app but a geo link tapped in a web page did not: a browser offers only activities that say they are browsable. Play Console's deep link check reported it as a broken link for the same reason. ArrivalTest's launches name the activity, so none of them touched the filters. A new test asks the package manager what a browser would reach for each link the app takes, the site's and a geo URI. Against the old manifest it fails on the geo link with an empty list; with the category it passes, with the other twelve arrival tests. The phone's version code goes to 2, since Play already holds 1. --- android/app/build.gradle.kts | 2 +- .../kotlin/com/gridpointcode/ArrivalTest.kt | 19 +++++++++++++++++++ android/app/src/main/AndroidManifest.xml | 5 ++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f518208..9f1ff93 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -35,7 +35,7 @@ android { applicationId = "com.gridpointcode" minSdk = 26 targetSdk = 37 - versionCode = 1 + versionCode = 2 versionName = "0.1.0" buildConfigField("String", "PACKS", "\"$packs\"") diff --git a/android/app/src/androidTest/kotlin/com/gridpointcode/ArrivalTest.kt b/android/app/src/androidTest/kotlin/com/gridpointcode/ArrivalTest.kt index 93ba666..11dd170 100644 --- a/android/app/src/androidTest/kotlin/com/gridpointcode/ArrivalTest.kt +++ b/android/app/src/androidTest/kotlin/com/gridpointcode/ArrivalTest.kt @@ -1,12 +1,14 @@ package com.gridpointcode import android.content.Intent +import android.content.pm.PackageManager import android.net.Uri import androidx.compose.ui.test.onNodeWithText import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.rule.GrantPermissionRule import com.gridpointcode.core.formatted +import org.junit.Assert.assertEquals import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -126,6 +128,23 @@ class ArrivalTest { reader.assertShowing("G3RJM8X3L1") } + /** + * The tests above name the activity, so they never touch the manifest. A + * browser does not: it offers only apps whose filter says browsable, and + * Play counts a link without it as broken. + */ + @Test + fun aBrowserCanHandEachLinkToTheApp() { + for (link in listOf("https://gridpointcode.com/play?c=G3RJM8X3L1", "geo:43.649061,-79.371679")) { + val tapped = Intent(Intent.ACTION_VIEW, Uri.parse(link)) + .addCategory(Intent.CATEGORY_BROWSABLE) + .setPackage(reader.context.packageName) + @Suppress("DEPRECATION") + val found = reader.context.packageManager.queryIntentActivities(tapped, PackageManager.MATCH_DEFAULT_ONLY) + assertEquals(link, listOf(MainActivity::class.java.name), found.map { it.activityInfo.name }) + } + } + @Test fun textSelectedInAnotherAppOpensItsPlace() { launch(Intent(Intent.ACTION_PROCESS_TEXT).putExtra(Intent.EXTRA_PROCESS_TEXT, "#G3RJM-8X3L1")) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4a412f8..9a86d30 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -57,10 +57,13 @@ - + +