Unable to get Applinks (with Rivets component) working on Android

喜欢而已 提交于 2019-12-13 05:59:12

问题


I am currently tring to setup deep linking in Android apps.

First, I would like to as if the app be run from any website (meaning host - "example1.com" or "example2.com") if they have the meta tags set correctly?

This is how my test web page looks like:

<!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>

In my Android app I put following Intent filter on my activity:

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

I launch the test site from my phone but nothing happens / gets launched. I am sure there must be something wrong but I am not sure what.

Note that I added Rivets component to my Xamarin Android App.


回答1:


The URL was wrong, it should have looked like this:

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

as mentioned in Android documentation:

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


来源:https://stackoverflow.com/questions/32253760/unable-to-get-applinks-with-rivets-component-working-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!