5 ms·
Android actually has functionality built in that can recognize certain URL patterns and offer up a chooser of which app to open the link in. You can register s
by redbeard0x0a 12y ago
Android actually has functionality built in that can recognize certain URL patterns and offer up a chooser of which app to open the link in.
You can register something like https://example.com/posts/{post_id} https://example.com/posts/{post_id} and have it open the posts activity and show the specified post (if the user chooses to open the url using the 'Example App'). If the app is not installed, the url is opened by the default handler of https...
- danielrhodes 12y agoYeah I've seen things like this before. The problem is that any app could register to listen to those addresses, and that opens up an avenue for mis-leading the user. I'm sure Google would not like it if the Bing app started trying to become the handler for google.com URLs. Likewise on iOS anybody can submit an app which listens to the fb:// URL. Overall it seems unsafe.
- chintan 12y ago@apple and @google could start domain registrar service for the "AppWeb"
- dozy 12y ago> I've seen things like this before It's actually pretty common in Android. Methinks you're an iOS user :) > any app could register to listen to those addresses This is core to the Android IPC design. Apps/Activities describe what they can handle (Intents, actions, filters), and I think it works pretty well. Android will ask you if you want the given app to be the default or not, and you can always un-set the default. Also, if you have a new app that can handle the given link, the next time you try to launch that link you'll be prompted to see if you want to use the new app, and your previous selected default will be highlighted as a reminder. Also, I'm generally a believer that if an app is registering for an Intent action filter that it does not handle well/shouldn't handle at all, then users will give it a lot of bad review feedback, and apps will trend towards doing the right thing.
- danellis 12y ago> The problem is that any app could register to listen to those addresses That's a feature, not a problem, and it's the kind of flexibility I expect from Android. Take the domain reddit.com, for example. There are several Reddit apps, two or three of which are very popular. If the app to open was controlled by the owners of reddit.com, how would my favourite third-party app be able to register to handle those links?
- deleted 12y ago[deleted]
- mintplant 12y agoAndroid already handles this. You get a popup box listing all of the apps that can handle a particular URL. You can choose whether to use that app just this time or to set it as default and not ask again. Defaults can be cleared in the system settings. This really is a solved problem on Android.
- bennyg 12y agoYou can do something similar with iOS as well - as far as handling parts of the url and query. One thing you can't do, unfortunately, is handle any url that starts with http - it has to be custom.
- tadfisher 12y ago...which is the main motivator for all of these deep-linking services. Having one URL that gracefully degrades to the browser when the user does not have your app installed is not currently possible without annoying server-side hackery on iOS.
- danielrhodes 12y agoRight. The problem that has arisen is creating that mapping between those HTTP urls and the app URL, especially since only the app developer knows that URL and how it is interpreted inside the app, is almost non-existent. What has resulted is a shadow set of URLs which only work if the app is installed (which you can't tell from the web). All the great network effects you get from hyperlinks on the web don't get passed over to the mobile ecosystem because of these properties (hidden URL structure, inconsistent with the web, etc.). When YouTube came pre-installed on iOS in the first few versions, when you clicked on an (HTTP) link to YouTube it would open the app. It was a great experience because the YouTube app had a nicer experience than the web. It would be great to be able to do this for more apps, if those apps wanted it.
- Apofis 12y agoYup, Android will recognize YouTube links and open them in the app, same for play store links, and reddit links. I'm sure there are others that I haven't encountered yet. As far as I'm concerned, the author's issue has already been solved.
- Sophistifunk 12y agoiOS does the same thing, at least for YouTube. It's why I keep uninstalling the app, as I hate the UI and most of the time I just want to stay in the browser.
- wutbrodo 12y ago> It's why I keep uninstalling the app, as I hate the UI and most of the time I just want to stay in the browser. They don't let you choose which app you want to use? I know that's consistent with the half-assed way iOS (and honestly, Android) implements many things in the OS, but it's still pretty bizarre that they'd offer URL handling but no way to choose which app to use once or permanently.
- pjc50 12y agoYou can unbind most of the intents, but I've not worked out a reliable way to stop youtube bouncing me to the app from the browser.
- Apofis 12y agoAndroid actually lets you choose the app to handle the link though, which is nice. I'm sure iOS will catch up in this regard at some point.