I have an Android app which needs to handle deep links, and I have installed a <server>/.well-known/assetlinks.json
file as documented.
I am hoping I can use the assetlinks.json
file to specify a more complex URL matching pattern than the AndroidManifest.xml intent-filter
allows.
Currently my assetlinks.json
looks like this:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.myapp",
"sha256_cert_fingerprints": ["12:34:...:CD:EF"]
}
}]
What are the options for the "relation": ["delegate_permission/common.handle_all_urls"]
entry? The name surely implies that there must be other options than handling all URLs, but I can't see how to specify what URLs to handle.
The Statement List Syntax doesn't offer any example other than common.handle_all_urls
and the detail just says "If you want to create a statement that does not fit one of these statement types, you can define your own unique string." But how?
For example I want to:
- Handle all URLs matching
https://server.example.com/project/*
- Except DO NOT handle
https://server.example.com/project/upload
The app's AndroidManifest intent-filter
has URL configuration options through android:pathPrefix
etc, but AFAIK it does not allow this kind of exclusion which is why I am hoping to use the assetlinks.json
file. (The intent-filter android:pathAdvancePattern
property does not work below Android 12, so is not enough to solve the problem.)