Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Use Chrome custom tabs in stead of Opening Chrome app

Open mario-galvan-dev opened this issue 8 years ago • 9 comments

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

mario-galvan-dev avatar Aug 18 '18 19:08 mario-galvan-dev

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 avatar Aug 20 '18 15:08 jamesmontemagno

@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?

mario-galvan-dev avatar Aug 20 '18 15:08 mario-galvan-dev

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.

jamesmontemagno avatar Aug 20 '18 16:08 jamesmontemagno

Thanks for the answer!

mario-galvan-dev avatar Aug 20 '18 16:08 mario-galvan-dev

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

jamesmontemagno avatar Aug 20 '18 16:08 jamesmontemagno

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

mario-galvan-dev avatar Aug 22 '18 18:08 mario-galvan-dev

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 avatar Aug 22 '18 18:08 jamesmontemagno

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

mario-galvan-dev avatar Aug 22 '18 18:08 mario-galvan-dev

@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.

007vel avatar May 18 '20 08:05 007vel