Reputation: 8726
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?
Upvotes: 7
Views: 1030
Reputation: 8726
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);
}
Upvotes: 4