Android深层链接未重定向到商店

时间:2017-07-10 07:19:41

标签: java android deep-linking

我已经定制了深层链接,对于拥有该应用的用户来说,它运行良好。但对于没有应用程序的用户,它不会将它们重定向到Playstore。

<intent-filter>

            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="abc.in"
                android:pathPrefix="/abc"
                android:scheme="http" />
            <action android:name="android.intent.action.VIEW" />
</intent-filter>

生成深层链接的MY代码

public void Share() {
    firebaseAnalyticsUtil.fireEvent("shared_link");
    Intent sharingIntent = new Intent(Intent.ACTION_SEND);
    sharingIntent.setType("text/plain");
    sharingIntent.putExtra(Intent.EXTRA_SUBJECT,"Hey!");
    sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Share Text - "+"http://abc.in/abc/"+ID);
    startActivity(Intent.createChooser(sharingIntent,"Share using"));
}

如果用户没有应用

,请协助我将用户重定向到Playstore

3 个答案:

答案 0 :(得分:1)

您使用的是App Links,这意味着这些是常规的http://链接。当您的用户点击http://abc.in/abc时,会发生以下两种情况之一:

  1. 如果您的应用已安装,用户可以选择打开它(直接将其发送到那里而不显示选择器,您需要Request App Links Verification)。
  2. 如果未安装所有内容,则用户将在其网络浏览器中转到http://abc.in/abc
  3. 您尝试处理的情况2,方法很简单:使用http://abc.in/abc页面将访问者重定向到Play商店。这可以通过Javascript或HTTP完成(307重定向是最常见的)。

    但请注意,仅凭这一点对于完整的深层链接解决方案来说还不够。你还需要支持......

    1. A custom URI scheme适用于App Links无法正常工作的情况。
    2. Chrome Intents适用于Chrome。
    3. Deferred deep linking以确保您的用户在下载后仍然会被发送到您应用中的正确位置。
    4. 我建议您查看托管的深层链接服务,例如Branch.io(完全披露:我在分支机构团队中)或Firebase动态链接。它们会让你的生活更轻松。

答案 1 :(得分:0)

使其适用于不会使用的用户。有你的应用程序,你可以使用Firebase动态链接。您还可以使用Firebase动态链接跟踪参数和分析。它是免费使用的。这是教程的链接。它很容易遵循教程。

https://firebase.google.com/docs/dynamic-links/

如果您在实施动态链接时发现任何问题,请随时与我联系。

答案 2 :(得分:-1)

要在PlayStore上重定向,请使用以下行;

  startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("use your playstore app Link")));
相关问题