2017-07-19 24 views
0

我有一个链接,如http://example.com/user/profile/MJi0aE 此处MJi0aE是用于重定向以查看特定用户配置文件的唯一用户标识。应用链接或带配置文件重定向的深层链接

预计: 如果我点击该链接从任何地方在移动例如:消息框,WhatsApp收件箱它应该打开应用程序和显示用户配置文件屏幕,如果已经安装了应用程序,否则它应该重定向到玩商店。

现在发生: 如果我点击该链接,它将重定向到应用程序(如果存在),但如果应用程序不可用则意味着它在浏览器中打开该链接并显示web中的用户配置文件。

以下是清单文件中的应用链接代码。

<intent-filter android:autoVerify="true"> 
      <action android:name="android.intent.action.VIEW" /> 
      <category android:name="android.intent.category.DEFAULT"/> 
      <category android:name="android.intent.category.BROWSABLE"/> 
      <data 
       android:scheme="http" 
       android:host="example.com" 
       android:pathPrefix="/user/profiles/" /> 
     </intent-filter> 

回答

0

您可以根据您已经使用以下网址http://example.com/user/profile/MJi0aE这是在您的清单被宣布为重定向,如果它存在手机与APP在下列方式实现这一目标。如下

<data android:scheme="http" 
     android:host="example.com" 
     android:pathPrefix="/user/profiles/" /> 

这是正确的。

对于其他情况下,你需要做的URL重定向(这是在服务器端重定向URL完成)无论何时,只要在任何浏览器或Web视图被击中指向你的谷歌Play应用地址。

实施例,如果应用程序名称是ExtAPP,

http://example.com/user/profile/MJi0aE将重定向到http://play.google.com/store/apps/details?id=com.app.extapp&referrer=test

+0

@Dev:让我知道你是否需要任何其他帮助! –