23

For example, I get an email from Pinterest with interesting links for the week. When I click a pin, it opens in Chrome and not in the Pinterest app. This happens with a few apps and was wondering if there's a way to "open link with" type of feature.

Is it possible to force the links to open in their respective application and not in the default browser (e.g. Chrome)?

7 Answers 7

13

Apps can request that links be opened using the app, using an API called an "intent filter".

If the app has the correct intent filter, you will be prompted to open the link using that app, and the app will then do something with it.

This has to be coded in by the app developer, and there is no way to implement it yourself unless you decompile the app and add it in.

An example of an app that does this is the Google+ app.

3
  • 2
    More examples include: Twitter, Google Maps, Foursquare. So it completely depends on the app developers.
    – ale
    Commented Jan 15, 2013 at 20:06
  • 2
    I find it strange that the Gmail app isn't doing that. For instance: on Chrome on Android, click on recent tab showing an email on Chrome desktop; it would make sense in that case to open that email in the Gmail app.
    – avernet
    Commented Nov 12, 2014 at 18:46
  • Please could you provide some documentation or further information regarding intent filter? Thanks a lot you'll probably get a lot more credit for this answer, very helpful.
    – 1984
    Commented Mar 24, 2019 at 0:03
6

This helper app makes Facebook, Twitter, Instagram, GitHub, and Goodreads links open in their apps instead of the browser: Open Link in App

It doesn't yet support Pinterest, but if you're technical, it's easy to add new apps, and doesn't require writing code! Details in the GitHub repo.

2
  • 1
    I installed Open Link in App and it's working! I have a database app and added a field for URL in one of the tables and it always open on browser before. Thank you for sharing.
    – Mr. Xymon
    Commented Oct 8, 2015 at 12:41
  • This doesn't work with Firefox in Android though?
    – endolith
    Commented Jul 30, 2017 at 17:38
2

If the links were opening in Chrome by default, all I had to do was, go to Settings -> Apps -> Set as default, choose the Chrome app and hit Clear defaults.

Next time when I clicked the link, the phone asked me to Open with with only two options: Chrome & Samsung Internet Browser. When I choose Chrome then Just once, once again the Open with came up but this time with 3 options: Pinterest, Chrome & Samsung Internet Browser. I chose Pinterest followed by Always and that is it.

Not sure why but this worked.

1
  • I don't use Pinterest, but I might have a guess that the first link is a shortened/compact URL that is not recognized by the Pinterest app, then the browser redirects to the link that is now recognized by the Pinterest app, hence the additional option on the 2nd link. (further info on how this works is on existing answer)
    – Andrew T.
    Commented Feb 15, 2019 at 21:38
1

If you can get the APK, then you can open it in JADX [1]:

jadx-gui com.pinterest-10098030.apk

and check the Androidmanifest.xml file:

<intent-filter android:autoVerify="true">
   <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
   <action android:name="android.intent.action.VIEW"/>
   <category android:name="android.intent.category.DEFAULT"/>
   <category android:name="android.intent.category.BROWSABLE"/>
   <data android:scheme="https"/>
   <data android:scheme="http"/>
   <data android:host="www.pinterest.com"/>
   <data android:host="post.pinterest.com"/>
   <data android:host="pin.it"/>
   <!-- ... -->
</intent-filter>

So only link with those host will get noticed by the app. In addition, some apps also filter on the path:

<intent-filter android:label="@string/app_name" android:autoVerify="true">
   <data android:scheme="https" android:host="www.pbs.org"/>
   <data android:pathPattern="/video/.*/"/>
</intent-filter>

Finally, if you have adb, you can use it like this:

adb shell am start -d https://www.pbs.org/video/american-horses-i5v309/
  1. https://github.com/skylot/jadx
0

In general, you can't do it. The reason behind the links opening in a browser is that they use the same protocols of normal web links. So if the particular app is not a browser, the links have to be opened with a browser app.

But you may have seen some links (particularly links to Android apps on the market) can be opened with the Android Market/Google Play Store app. This is possible because those links use market:// in their links rather than typical http://

If you need to confirm it, try clearing the defaults of your Chrome browser. It will make you choose an app to open a link when you click them. This will give you an open link with option (of course, to use the browser apps)

To do this, go to Settings -> Apps and select the Chrome app. Scroll to the bottom and find a clear defaults button and click it.

2
  • 4
    This isn't actually true. An app can register an intent to open any URL, even if it uses http. For example, the Play Store app will handle http://play.google.com/store/apps/details?id=foo links, as well as market:// links.
    – Dan Hulme
    Commented Jul 9, 2013 at 22:36
  • This is false. To open http/https links directly you need to to verify ownership of the domain using a .well-known/assetlinks.json file. See developer.android.com/training/app-links You can show the capability to open unverified domains, but the user needs to set your app as the default app themselves, otherwise it will open in the browser (this wasn't actually true until Android 12, where it would ask which registered app you wanted to use)
    – DennisK
    Commented Apr 17 at 7:27
0

In my case Gmail messages containing links to Realtor.com stopped opening in the realtor.com app one day and instead started opening in Chrome. On Samsung Galaxy S23 Ultra with Android 14 I found the solution here:

  • Substitute realtor.com with your app name

  • Settings/Apps/realtor.com

  • Under Defaults:
    Select: Set as Default

  • Supported Links: Enable

  • Supported Web Addresses
    Enable those matching the link URL which isn't opening in the app. If Supported Web Addresses is greyed out, make sure the app is installed and able to open with links here:

  • Settings/Apps/Choose Default Apps/Opening Links

  • Find your app (again realtor.com for me), make sure Open Supported Links is enabled.

  • Tap Supported Web Addresses and enable the addresses you want to open in the app and not the browser.

This gives the option to select whether to open this app instead of the browser when you go to supported web addresses.

-1

JUST REMOVE http:// or https:// bofore URL and Enjoy!

2
  • 1
    Is this specifically for Pinterest? Are you sure it will work? Browsers will usually add http:// automatically if the input looks like a URL, so it won't really change anything.
    – Andrew T.
    Commented Jul 1, 2021 at 14:09
  • 1
    This won't work for a link - as the question requires - as that will already have the protocol prefix included within it.
    – Chenmunka
    Commented Jul 1, 2021 at 18:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .