iOS和Android共享HTTP深层链接?

我试图通过一个URL(通过电子邮件等共享)启动我的本地应用程序。 看起来,Android只响应HTTP深层链接URL(例如http://myapp.com/stuff ),并且iOS只响应非HTTP自定义深层链接URL(例如,myapp:// stuff)。 有没有人find一个单一的解决scheme,使两个操作系统打开相同的url?

另外,iOS可以使用HTTP深层链接url吗? 类似于http://youtu.be将如何打开本机iOS应用程序。 Facebook也这样做。

谢谢! 🙂

本文可以是有用的“iOS和Android的URLscheme”: http : //fokkezb.nl/2013/09/20/url-schemes-for-ios-and-android-2/

编辑:发送用户链接到网站的主要想法。 在服务器上使用平台检测,我们可以返回正确的链接:

 function open() { // If it's not an universal app, use IS_IPAD or IS_IPHONE if (IS_IOS) { window.location = "myapp://view?id=123"; setTimeout(function() { // If the user is still here, open the App Store if (!document.webkitHidden) { // Replace the Apple ID following '/id' window.location = 'http://itunes.apple.com/app/id1234567'; } }, 25); } else if (IS_ANDROID) { // Instead of using the actual URL scheme, use 'intent://' for better UX window.location = 'intent://view?id=123#Intent;package=my.app.id;scheme=myapp;launchFlags=268435456;end;'; } }