【问题标题】:Unable to get Applinks (with Rivets component) working on Android无法让 Applinks(带有铆钉组件)在 Android 上运行
【发布时间】:2015-08-27 15:36:46
【问题描述】:

我目前正在尝试在 Android 应用中设置深度链接。

首先,如果它们的元标记设置正确,我想就好像从任何网站(意思是主机 - “example1.com”或“example2.com”)运行应用程序?

这是我的测试网页的样子:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">

  <title>Jakubs Applinks Test</title>
  <meta name="description" content="Jakubs Applinks Test">
  <meta name="author" content="Jakub Holovsky">
  <meta property="al:android:url" content="jakubsapp://login" />
  <meta property="al:android:package" content="com.jakubsapp.android" />
  <meta property="al:android:class" content="com.jakubsapp.android.LoginActivity" />
  <meta property="al:android:app_name" content="Jakubs App" />
  <meta property="al:web:url" content="[some fallback url]" />
</head>

<body>
</body>
</html>

在我的 Android 应用中,我在我的活动中添加了以下 Intent 过滤器:

[Activity (Label = "LoginActivity")]
[IntentFilter(new [] {Android.Content.Intent.ActionView }, 
    DataScheme="*", 
    DataHost="jakubsapp",
    DataPath="login",
    Categories=new [] { Android.Content.Intent.CategoryDefault })]
public class LoginActivity : BaseActivity
{

我通过手机启动测试站点,但没有任何反应/启动。我确信一定有什么问题,但我不确定是什么。

请注意,我将 Rivets 组件添加到我的 Xamarin Android 应用程序中。

【问题讨论】:

    标签: android intentfilter applinks


    【解决方案1】:

    网址错误,应该是这样的:

    <meta property="al:android:url" content="http://jakubsapp/login" />
    

    as mentioned in Android documentation:

    <scheme>://<host>:<port>[<path>|<pathPrefix>|<pathPattern>]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-09
      • 1970-01-01
      • 1970-01-01
      • 2011-04-11
      • 2013-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多