Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Chrome Custom Tabs require the user to download the Chrome app?

In order to use Chrome Custom Tabs, do you have to expect your users to download Chrome(Beta) separately, or is it included when you implement Chrome Custom Tabs into your application?

like image 249
God Usopp Avatar asked Oct 11 '15 09:10

God Usopp


2 Answers

When there is no Chrome browser Installed, you can alternative use the CustomTabFallback if you like. Here you can implement alternative solutions for that case:

/**
 * A Fallback that opens the WebviewActivity when Custom Tabs is not available
 */
public final class WebviewFallback implements CustomTabActivityHelper.CustomTabFallback {

@Override
public void openUri(final Activity activity, final Uri uri) {
    final Intent intent = new Intent(activity, WebviewActivity.class);
    intent.putExtra(WebviewActivity.EXTRA_URL, uri.toString());
    activity.startActivity(intent);
}

}

Here i use an Activity to load the URL, which just uses an WebView,i just pass the Uri to it. It really depends what you need. So you can have multiple fallback types if you like.

like image 192
Kitesurfer Avatar answered Oct 13 '22 18:10

Kitesurfer


For Custom Tabs to work, the user needs to have a browser that supports Custom Tabs installed.

It is already available on the production Chrome, since version 45.

Currently, Chrome is the only browser that supports it, but as it's an open protocol, other browsers are expected to support it in the future.

like image 38
andreban Avatar answered Oct 13 '22 18:10

andreban