Essentials: Use Chrome custom tabs in stead of Opening Chrome app

Created on 18 Aug 2018  路  9Comments  路  Source: xamarin/Essentials

Description

I want to keep the users on my application while opening a url (On Android), I don't want to open the chrome application.
Like this post:
https://blog.xamarin.com/keep-users-from-leaving-your-app-with-chrome-custom-tabs/

Steps to Reproduce

  1. await OpenBrowser(new Uri(https://twitter.com/));

Expected Behavior

I am not sure if this should be the expected behavior.

Actual Behavior

It opens the Chrome application.

Basic Information

  • Version with issue: 0.10.0-preview
  • Last known good version: n/a
  • IDE: Visual Studio for Mac
  • Platform Target Frameworks:

    • Android: 8.1

  • Android Support Library Version: 27.0.2.1
  • Nuget Packages: n/a
  • Affected Devices:
  • Nexus 5 Android 6.0 (Simulator)
  • Samsung Galaxy S7 Android 7.0 (Real device)

Screenshots

https://media.giphy.com/media/d2SdNnemNEdR2JzJZE/giphy.gif

unable-to-reproduce

Most helpful comment

I do have a S7 that I will test on tomorrow though and see.

All 9 comments

This does not work on emulators, you need to use on a real device. Tested on my Pixel 2XL and unable to reproduce this.

@jamesmontemagno Sorry but on the notes I added a real device:
Samsung Galaxy S7 with Android 7.0

Do you think this is device specific?

It is highly possible depending on what version of Chrome it has, and what support libs you are using. I am testing on Pixel 2 XL.

It is also possible that samsung blocks it.

Thanks for the answer!

I do have a S7 that I will test on tomorrow though and see.

@jamesmontemagno Did you had a chance to test this with a S7?

so realized i have an s8 today....

Tested it on pixel 2 xl, huawei p8 lite, and hero se, and samsung s8 all with chrome installed and worked perfect. The custom tab came up with the X in the top left and the overflow on top right and says "powered by chrome".

@jamesmontemagno Thanks for the heads up I will investigate further.

@jamesmontemagno In my case. First-time custom tab opening in my app, when I try to load URL at the second time, it opens the chrome application instead of a custom tab.

Was this page helpful?
0 / 5 - 0 ratings