Better content sharing with Custom Tabs

Custom Tabs is a browser feature, introduced by Chrome, that is now supported by most major browsers on Android. It gives apps more control over their web experience, and makes transitions between native and web content more seamless without having to …


This content originally appeared on Chromium Blog and was authored by Chromium Blog

Custom Tabs is a browser feature, introduced by Chrome, that is now supported by most major browsers on Android. It gives apps more control over their web experience, and makes transitions between native and web content more seamless without having to resort to a WebView. Similar to when using the browser, users frequently want to share the content that is rendered inside the Custom Tabs.

Custom Tabs do not provide a default sharing experience and many apps don’t provide a way for users to share content at all. This results in a poor user experience where users must find the share action from the overflow menu in the browser. This action takes the user outside of the app and opens the link in the browser, resulting in decreased app engagement.

In Chrome 88 we're running an experiment to automatically add a default share action in certain scenarios. For example, where an app has not specified its own Action Button, we will display one in the top bar. Where a site has specified its own top bar Action Button, a default share action is added to the overflow menu.


A default Action Button that shares the URL is added to the top bar when the application doesn’t provide one.

What do I need to do to enable the new default share action button in?

Nothing! The default Action Button will be automatically added to the application, as long as the application doesn’t set its own. Since this change will happen in the browser, it will be automatically applied to all apps using Custom Tabs.

Please note: this is a change in Chrome’s behavior and we hope other browsers will add similar functionality.


How can I opt-out from the share icon showing in my App?

Starting with androidx.browser version 1.3.0, developers can use the setShareState() method from the CustomTabsIntent.Builder to disable the default share:

val customTabsIntent = CustomTabsIntent.Builder()

        .setShareState(CustomTabsIntent.SHARE_STATE_OFF)

        .build();


As part of this change, the addDefaultShareMenuItem() and setDefaultShareMenuItemEnabled() methods from CustomTabsIntent.Builder have been deprecated and developers should use setShareState() instead.


If your application uses Custom Tabs, we’d like to hear your feedback, and you can reach out to us using this form.



This content originally appeared on Chromium Blog and was authored by Chromium Blog


Print Share Comment Cite Upload Translate Updates
APA

Chromium Blog | Sciencx (2021-01-22T16:00:00+00:00) Better content sharing with Custom Tabs. Retrieved from https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/

MLA
" » Better content sharing with Custom Tabs." Chromium Blog | Sciencx - Friday January 22, 2021, https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/
HARVARD
Chromium Blog | Sciencx Friday January 22, 2021 » Better content sharing with Custom Tabs., viewed ,<https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/>
VANCOUVER
Chromium Blog | Sciencx - » Better content sharing with Custom Tabs. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/
CHICAGO
" » Better content sharing with Custom Tabs." Chromium Blog | Sciencx - Accessed . https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/
IEEE
" » Better content sharing with Custom Tabs." Chromium Blog | Sciencx [Online]. Available: https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/. [Accessed: ]
rf:citation
» Better content sharing with Custom Tabs | Chromium Blog | Sciencx | https://www.scien.cx/2021/01/22/better-content-sharing-with-custom-tabs/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.