Issue metadata
Sign in to add a comment
|
Deep linking not happenning in Chrome 55
Reported by
subi...@gmail.com,
Jan 16 2017
|
||||||||||||||||||||
Issue description
Device name: 1) Google Nexus 5,
2) Moto G 2nd Generation
From "Settings > About Chrome"
Application version: 55.0.2883.91
Operating system: 1) Android 6.0.1 Nexus 5 Build/M4B30X,
2) Android 6.0.0; XT1079 Build/MPB24.65-24
URLs (if applicable):
Description:
We have an android app where an activity is supposed to be kicked off when a particular mimeType is send from server response. The steps are like this
1. Servers send a link via SMS or email
2.User clicks on the link and the link opens in Chrome browser (as this is the defualt browser now a days in android system)
3. Chrome sends the request and receives response packet along with mimeType from the server
4. Chrome then invokes our app based on the intent (internal process might be like this - chrome broadcasts intent and seeing this intent aour app will be invoked)
5. Our app then takes control and client - server communication is established.
The above scenario was working till Chrome 51. Chrome 44 was also working. Now when we upgraded chrome to version 55, Step 4 is no longer working. Chrome it not invoking our app. Instead it is downloading the server response packet as a binary file. Hence our server-client communication is completely broken. This is now a critical issue for us.
Can you please provide us a fix or an workaround?
Steps to reproduce:
(1) Install an android app with an activity say, MyActivity and open it once.
(2) In android manifest have the following lines
<activity android:name="MyActivity" android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http" android:mimeType="application/vnd.wap.connectivity-wbxml"/>
<data android:scheme="https" android:mimeType="application/vnd.wap.connectivity-wbxml"/>
</intent-filter>
</activity>
(3) In the browser hit a URL to a server that will send a response along with a mimeType in the response header. It is not necessary that mimeType has to be "application/vnd.wap.connectivity-wbxml". It can be any industry standard mimeType.
(4) Verify if the app is getting invoked
Alternatively, if the above process is cumbersome, we can simplify using adding
<data android:host="my.host.name" /> instead of <data android:scheme="https" .../> so that any response coming from my.host.name should invoke the app.
Expected result:
The android app's MyActivity should be invoked.
Actual result:
The android app's MyActivity is not invoked. Rather, the chrome browser is downloading the http response as a binary file.
Please note that it was working till chrome 51. Even Firefox on android (v 50.1.0) is also working
Thanks
Subijay
,
Jan 18 2017
Maria, do you remember what change went in to cause this? Intended?
,
Jan 18 2017
We actually never redirect to apps based on response -- we only redirect to apps based on request data (before the request actually occurs). The visible behaviour change may be due to our changes to the download system. Min, can you comment on that?
,
Jan 18 2017
Looks like a user gesture related issue. When clicking a link to start Chrome, how the user gesture is passed into Chrome? If not, we don't allow an external app to be invoked. Can you try clicking a link inside Chrome, to see if step 4 is executed?
,
Jan 19 2017
Hi, I will have to take product manager's opinion if the app and the server can be shared as this is an enterprise app and it belongs to Nokia. I will revert back to you. Thanks Subijay
,
Jan 23 2017
I am attaching simple apk file which simulates same behavior like our bootstrap does. It will start activity (just a dummy window on device) once URL with special mediaType got clicked. I also deployed sample servlet on our demo server (accessible via internet) http://195.207.5.235:8088/webapp_war/test. once you install that application (note it does not have default activity, so no app icon will be visible on device) and in browser just enter URL which I mention. in firefox it will ask which application to start with that URL (TestActivity is the name of that demo app). click on that icon and the dummy dialog window will open. From chrome55 it will just download without promting.
,
Jan 30 2017
Hi, Any updates on this please? Were you able to reproduce the condition?
,
Feb 1 2017
Hi, We had a very similar issue in our company as well, where deep links were all of a sudden "not happenning" in the WebView, starting from Chromium v55. It seems like I've found the root cause of the issue, and the solution as well, I hope this may help you in some way, as our use case is not exactly the same. Check out the documentation of the android WebSettings, especially about the mixed content mode: https://developer.android.com/reference/android/webkit/WebSettings.html#setMixedContentMode(int) The documentation states that up until KitKat, the WebSettings defaults to MIXED_CONTENT_ALWAYS_ALLOW, but beginning with Lollipop, the default setting is MIXED_CONTENT_NEVER_ALLOW. I am not exactly sure, but I think that custom schemes are blocked with MIXED_CONTENT_NEVER_ALLOW. Both of your mentioned test devices are running Marshmallow, so it should default to MIXED_CONTENT_NEVER_ALLOW. I think what happened is, the WebView never actually used these settings, and it only started to work as documented with Chromium v55, hence the break of functionality. The solution is fairly simple, at least this worked for us: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { WebSettings webSettings = webView.getSettings(); webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE); } While I understand that you don't use in app WebView, but the Chrome app, investigating the mixed content mode might help.
,
Feb 3 2017
Actually I don't think our app has issue due to WebSettings, the link in chrome is accessible and user can hit and access the HTTP URL, the only issue is that Chrome somehow downloads the content and do not check for apps that are listening to some specific mimetype and does not allow external app activities to be triggered.
,
Feb 6 2017
I did some tests with different android chrome versions (in emulator): here are the results: chrome 53.0.2785.135 - worked ok. chrome 55.0.2883.91 - does not work chrome 57.0.2987.19 (known as Chrome Beta) - does not work so it seems that something definitely was changed in the Chrome 55 version. |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by rbyers@chromium.org
, Jan 18 2017Components: Mobile>Intents
Labels: Type-Bug-Regression