Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can iOS Support Deep-Links Within the HTTP Scheme?

Under Android, you can capture part of the "http" space and use it to deep-link into an app. The YouTube app for example uses this so any links to http://www.youtube.com/ have the option of opening in the native app instead.

Is it possible to do the same with iOS deep linking? My searching shows examples only with custom schemes so I'm guessing not.

If not, how could it be accomplished? Can I have my web server do a 302 redirect from the http url to a url with my custom scheme?

Or even better, how could I detect if the app is installed and either deep-link into it or send the user to the appropriate download page?

like image 748
Brian White Avatar asked Jan 21 '15 13:01

Brian White


People also ask

Does deeplink work for iOS?

There are 2 ways of implementing deep linking in IOS: URL scheme and Universal Links. While URL schemes are a well-known way of having deep linking, Universal links are the new way Apple has implemented to easily connect your webpage and your app under the same link.

What is deep link on Iphone?

Deep link is a technology that launches an app and opens a specific page in the app once the user clicks a URL on a web page or in another app. Implementing deep links is an exciting way to enhance the user experience by seamlessly allowing users to access the specific page without interruption.


1 Answers

I can happily report that a redirect from a server's http address to a custom scheme works under both Android and iOS. Would be better not to have to do this, though, so still looking for other ideas.

Here's the code I used in an otherwise empty App-Engine servlet:

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    String query = req.getQueryString();
    String deeplink =
            "example:/" +  // pathinfo includes leading slash
            req.getPathInfo() + (query != null ? "?" + query : "");
    resp.sendRedirect(deeplink);
}
like image 185
Brian White Avatar answered Sep 28 '22 20:09

Brian White