3

I have an application which supports all urls having xyz as domain.

So now if I sent my users a message or a mail containing the link of the above domain like xyz.com/abc or maybe xyz.com, for mobile IOS users the link opens in browser but for mobile android users there is a pop up which asks the user to choose whether they want to open the link in my app or the browser.

I have an issue with what the android is doing. I don't want that pop up for some particular links, I want that link to open in browser instead of the application. Is there a way I can achieve it by setting some headers in the response or maybe setting some meta tags in the html.

Thanks in advance for the help!!

roman28
  • 41
  • 2
  • For further clearance : https://stackoverflow.com/questions/19357191/does-meta-name-google-play-app-work : look at the second answer with 34 upvotes, If maybe I can pass `content="app-id=com.google.chrome"` in my html tags to force the page to open in chrome. I know it is kind of a hack. – roman28 Jun 18 '18 at 07:19
  • Possible duplicate of [Block mobile website to open my app android deeplink - Google Chrome](https://stackoverflow.com/questions/42301286/block-mobile-website-to-open-my-app-android-deeplink-google-chrome) – davidwebster48 Oct 31 '19 at 00:47

1 Answers1

-1

You can get you domain host from the URL:

        Uri url = Uri.parse("www.xyz.com/lol");
        String host = url.getHost();

        if (host.equals("xyz.com")) {
            openInAppMethod();
        } else {
            openInBrowserMethod();
        }

And then choose the way to open your url.

Anton Prokopov
  • 639
  • 6
  • 27
  • For further clearance : https://stackoverflow.com/questions/19357191/does-meta-name-google-play-app-work : look at the second answer with 34 upvotes, If maybe I can pass `content="app-id=com.google.chrome"` in my html tags to force the page to open in chrome. I know it is kind of a hack. – roman28 Jun 18 '18 at 07:22