Search code examples
androidxamarin.androidandroid-support-librarychrome-custom-tabsandroid-customtabs

App doesn't open chrome if Terms & Conditions are not accepted


I'm building an app using Xamarin.Android which is meant to open a URL in Chrome when a user taps on a cell. Everything was working just fine up until a couple of hours ago. It was working fine on one device but not on another. There was no indication as to why it was not opening Chrome on one of the phones. After some time, I manually opened Chrome to make sure that everything was alright with it and found out that it had automatically updated itself a couple of minutes earlier and I had not accepted their Terms & Conditions. After accepting them, everything was working just fine again.

My issue is that there is no indication that the problem is with Chrome's EULA and it looks as if my app is the one which has the problem. I'm using the code below to launch the URL using the CustomTabsLibrary:

var intent = builder.Build ();
var mgr = new CustomTabsActivityManager (this);
mgr.CustomTabsServiceConnected += delegate {
mgr.LaunchUrl ("http://xamarin.com", intent);
};
mgr.BindService ();

The callback below gets called when Chrome is not installed on the device, but this not the case. In our case if the user does not accept the EULA of Google Chrome's app, we don't have any available callback to know and as a result, it doesn't redirect the user to the URL.

if (!mgr.BindService ()) {
   // Cannot use Custom Tabs,
   // Launch the URL another way
}

Has anyone ever had this issue before? Is there any way we can solve this issue? CustomTabsLibrary

Relevant question on Stackoverflow


Solution

  • It appears that Google has now fixed the issue on Chrome. When TOS have not been accepted by the user, the callback is now called and launches Chrome, as it should, taking you to the screen where you can accept the TOS.