-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deep links broken by default on Android 12+ #308
Comments
@jkuester A few questions that I was too lazy to investigate myself...
Yet another reason to favour PWAs... |
It is done when the app is installed on the device (does not have anything to do with the Play Store). In the Android docs it says "install the app on your device. Wait at least 20 seconds for the asynchronous verification process to complete."
Reading through the above-linked docs, it seems like once the intent is verified (at the time of installation), the result is cached by Android and the intent does not need to be re-verified each time a deep link is used. (The docs describe a process to use
This would only work if we update the intent registered by the cht-android apps to just be One thing that has not been mentioned yet is that the Android docs do provide a recommended method for prompting the user to manually verify the app links. I assume this process is similar to prompting the user for location access, etc. If the user manually approves the app link, there is no need for automatic verification. |
1 similar comment
It is done when the app is installed on the device (does not have anything to do with the Play Store). In the Android docs it says "install the app on your device. Wait at least 20 seconds for the asynchronous verification process to complete."
Reading through the above-linked docs, it seems like once the intent is verified (at the time of installation), the result is cached by Android and the intent does not need to be re-verified each time a deep link is used. (The docs describe a process to use
This would only work if we update the intent registered by the cht-android apps to just be One thing that has not been mentioned yet is that the Android docs do provide a recommended method for prompting the user to manually verify the app links. I assume this process is similar to prompting the user for location access, etc. If the user manually approves the app link, there is no need for automatic verification. |
Verification at install time makes sense and when installing from play store you will have a connection so is not a problem, but this could be a pain for sideloaded installs. |
According to some wise peeps on StackOverflow, for side loading, they can enable deep linking manually from app settings:
|
@dianabarsan - @jkuester and I have verified your SO comment: after you side load, if you go into that app info setting dialog, the deep links do indeed work as advertised! I suspect the same would be true of Play Store installed apps too. A good work around to know about! |
Hey all - after chatting with @craig-landry - I think this is current not a top priority for us to fix. this is for a couple of reasons:
We'll no doubt have to fix this eventually, but I think not just right now! |
Not commenting on the priority of this issue, but just want to clarify that I believe a change to the cht-android app would be necessary to get auto-verification working on Android 12+. The documentation indicates that you have to have |
thanks @jkuester ! That's a much bigger imposition on an already deployed APK...we'll have to take that into account then. |
@mrjones-plip It may be time to revisit this given we're finding Android 14 devices are being deployed (#332). |
@garethbowen - yes, agreed, now is the time! While no one is actively using token login links with Android 12+, Allies can spend another cycle or so doing some prep in Android land. Note the initial work will only support the CHT Android side of the work. We'll have to add support to the CHT Core later. |
As we get ready to actually address this issue, here is a more focused list of things that need to happen (based on the discussion/documentation above):
(Edit: updated tasks to associate testing work with the actual functionality being added (and to note that we will be pursuing an expansion of the e2e test functionality of cht-android to involve actually spinning up a test instance of the CHT that we can login to and interact with.)) |
Updates
The automatic verification process(referring to the quote above) has been accomplished. When the
TestingThis section outlines how this change was tested.
Testing for applications with multiple domainsIf an application needs to handle multiple domains that should all open within the same application, the web servers for each of those related domains must publicly host the Note the You can also use All the domains will be listed under |
Updates: Contents: android_deep_links_issue_compressed.mp4 |
Hi, @sugat009. Thank you so much for the detailed explanation of how to test this and the video. You rock!
|
Hello, @lorerod
|
@sugat009 I tested single and multiple domains, with physical phones running on Android 14, 10, and 8.1. It works as expected in every phone and scenario. I will add more details of these tests in another comment.
|
@lorerod This seems to be a bug in Android Studio(for Android 7) when installing applications using the drag-and-drop technique. I discovered this when trying to update Google Chrome by doing the drag-and-drop. The alternative way of installing the application is using the run button in Android Studio(in the Screenshot below). The thing to be careful of here is when running through the run button, the application is also opened after installation so, Android might not have gotten the time to verify the links producing negative results. |
The first issue might be because only 2 APK files are being generated on your PC whereas the second one is likely because the browser is old and incompatible with the hosted CHT version. For the browser-CHT compatibility matrix, please check here. |
Posting this publicly from a private issue as it will benefit everyone looking into this issue and wondering about the "asset link modal" issue:
|
Describe the bug
Android 12 raised the bar on what is required for automatically providing deep links to your application (via intents). TLDR is that getting it to work will require deploying a file with a hash out onto each server referenced by a deep link. (The idea is that Android can use that file to "automatically verify" your deep link.)
On previous versions of Android, it was enough to just register an intent with the configured
app_host
value. Once the app was installed on a device and the user clicked a link that included theapp_host
domain, they would be prompted to choose if they wanted to open the link in the app or in the browser.To Reproduce
Now on Android 12+, once you install the app and open a link, you are never prompted to open it in the app (it just goes straight to the browser).
Expected behavior
The only silver lining here is that once everything is configured for the deep links to actually work, the user should not even see the prompt for selecting where to open the link. Instead these auto-verified deep links should just open by default in the app. (Removing a point of confusion/error on the user side....)
Environment
Additional context
You can actually manually re-enable the deep-link behavior on each device by manually verifying the links. Open Settings > Apps > YOUR_APP (e.g. Medic (gamma)) > Open by default. Select "Add link" and choose the configured link from the list.
The text was updated successfully, but these errors were encountered: