1

I'm trying to implement custom tabs into my app

https://developer.chrome.com/docs/android/custom-tabs/integration-guide/

I've successfully launched the website using

@OnClick(R.id.btn_launch)
void onLaunchBtnClick(){
      String url = "https://paul.kinlan.me/";
      CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
      CustomTabsIntent customTabsIntent = builder.build();
      customTabsIntent.launchUrl(this, Uri.parse(url));
}

However it's launching as a mobile site everytime. How can I force it to launch as a desktop site without having the user clicking checkbox?

enter image description here

DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
  • 1
    I think it is more a Chrome behavior other than Chrome custom tab behavior, maybe you can setup a new subdomain in your website like `"https://m.paul.kinlan.me/"` and `https://paul.kinlan.me/` to differentiate desktop and mobile user? – Ng Sek Long Jun 24 '21 at 04:39
  • @NgSekLong thanks, but that was just the site in the demo. The one I plan to use in production automatically detects if I'm on a mobile phone and displays ```"This wallet is designed for desktop. Please download our mobile app."``` – DIRTY DAVE Jun 24 '21 at 06:21
  • If the Production site is not under your maintenance, I don't think there is much you can do.... Chrome custom tab (as far as I know) do not have feature to force user to go to desktop view. – Ng Sek Long Jun 24 '21 at 07:07

0 Answers0