3

Unlike the answer to
Chrome Custom Tab does not go back to app

My app works correctly when pressing the x or using the back button. However, when the server redirects the user back to the app inside the custom tab the window does not close. The redirect is a javascript intent to deep link back into the app. If I use a browser and skip the custom tab the redirect works correctly and closes the browser window. I have tried several values for the launchMode and noHistory in the Manifest but it's not making any difference.

Skipping the Chrome tab and going straight to a browser is the only choice. The user experience with Tabs would be much, much better. The behavior seems to change with different Android versions and gets worse with Android 6 and 7. The only error I can find in the unfiltered adb logcat is: 12-28 23:58:50.580 3595-3713/? I/ActivityManager: Displayed com.modolabs.kand28/com.modolabs.kurogo.core.activity.LoginActivity: +117ms 12-28 23:58:50.590 32437-13513/? W/System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/com.android.chrome/files/android_ticl_service_state.bin

This says that ActivityManager has started LoginActivity inside my app as it should but the LoginActivity window is behind the Chrome Custom Tab. If I complete the user action that invokes the redirect and then manually close the tab using the X, then I can get to the app and I see it is doing what it is supposed to do. My app is not getting focus to be put in the foreground on top of the tab.

Anybody else seeing this? Any suggestions?

Community
  • 1
  • 1
Beth Mezias
  • 270
  • 3
  • 13
  • Hi Beth, we're experiencing a similar issue (happens ~50% of time) while using AppAuth. Have you ever found a solution to this? – Michal Mar 27 '18 at 20:31
  • It's been a while since this problem got solved. IIRC, the dummy activity that opens the custom tab that was getting in the way and reopening the custom tab when the app opened a new activity from a deep link. So the puzzling thing was actually obvious -> custom tab dummy activity is on top and opens custom tab (leaves app). Browser interaction taps javascript deep link. Link Opens activity that finishes - it has no UX and exists to process custom tab interaction. The app finishes there and returns to the dummy which immediately reopens the custom tab. How about that? – Beth Mezias Mar 28 '18 at 21:07
  • The solution was to stop the dummy activity from opening a new tab with onResume and ultimately to explicitly finish the dummy activity that opens the custom tab – Beth Mezias Mar 28 '18 at 21:07

0 Answers0