From ab75a8351a25e812f364c34a236ccd557c4974bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Menu?= Date: Fri, 17 Jul 2026 21:37:04 +0200 Subject: [PATCH] Fix Google Play Console flagging the test app's deep links The Play Console flagged the test app with "Direct links don't work" because the ImportActivity VIEW intent filters declared http/https schemes with a wildcard host, which deep link validation cannot verify. These schemes (and BROWSABLE) are unnecessary for side-loading, since apps and browsers hand files over via content:// URIs. Remove them along with the vestigial app scheme, document the rationale in the manifest, and add a side-loading section to the "Opening a publication" guide. Fixes #426 Co-Authored-By: Claude Fable 5 --- docs/guides/open-publication.md | 6 ++++++ test-app/src/main/AndroidManifest.xml | 15 ++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/guides/open-publication.md b/docs/guides/open-publication.md index 96a008ac09..a23798cff6 100644 --- a/docs/guides/open-publication.md +++ b/docs/guides/open-publication.md @@ -84,3 +84,9 @@ The `AssetRetriever` offers an additional constructor that provides greater exte * `FormatSniffer` which identifies the file formats that `AssetRetriever` can recognize. You can use either the default implementations or implement your own for each of these components using the composite pattern. The toolkit's `CompositeResourceFactory`, `CompositeArchiveOpener`, and `CompositeFormatSniffer` provide a simple resolution strategy. + +## Accepting publications shared by other apps (side loading) + +To let users open publications in your app from a file manager, an email client or a browser download, declare intent filters for the `VIEW` and `SEND` actions on the activity handling imports. The [test app manifest](https://github.com/readium/kotlin-toolkit/blob/develop/test-app/src/main/AndroidManifest.xml) demonstrates a working setup, matching both media types and file extensions. + +A word of warning: restrict the `VIEW` filters to the `content` (and legacy `file`) schemes. Declaring the `http`/`https` schemes with a wildcard host will make the Google Play Console flag your app during deep link validation ("Direct links don't work"), as it cannot verify a wildcard domain. These web schemes are unnecessary for side loading, since apps and browsers deliver files through `content://` URIs. diff --git a/test-app/src/main/AndroidManifest.xml b/test-app/src/main/AndroidManifest.xml index 9ea37af3bb..151b4458e1 100644 --- a/test-app/src/main/AndroidManifest.xml +++ b/test-app/src/main/AndroidManifest.xml @@ -67,6 +67,12 @@ 4. `android:pathPattern` is case sensitive and is not using a true regex (it's just globbing), so we need to match the uppercase versions of file extensions as well. + + 5. Don't declare the `http` and `https` schemes (nor the BROWSABLE category) in the + VIEW filters. Combined with a wildcard host, they fail the Google Play Console + deep link validation ("Direct links don't work", see issue #426). They are not + needed for side loading: apps and browsers hand files over with `content://` (or + legacy `file://`) URIs. --> @@ -75,7 +81,6 @@ - @@ -110,13 +115,9 @@ - - - - @@ -147,15 +148,11 @@ - - - -