Forum Xamarin.Android

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

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.

Best Answer

  • CheesebaronCheesebaron DKInsider, University mod
    Accepted Answer

    Yes, exactly:

    Your IntentFilter is:

    [IntentFilter(new [] {Android.Content.Intent.ActionView }, 
        DataScheme="*", 
        DataHost="jakubsapp",
        DataPath="login",
        Categories=new [] { Android.Content.Intent.CategoryDefault })]
    

    Your Scheme is set to *
    Your Host is set to jakubsapp

    The url you provide on your webpage is: jakubsapp://login

    In that case the Scheme is jakubsapp, Host is login.

    You need to be more consistent.

Answers

  • CheesebaronCheesebaron DKInsider, University mod

    jakubsapp://login

    Scheme here is jakubsapp
    Host is login

    Fix your intent filter.

  • JakubHolovskyJakubHolovsky CZMember
    edited August 2015

    This is from official Android documentation:

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

  • CheesebaronCheesebaron DKInsider, University mod
    Accepted Answer

    Yes, exactly:

    Your IntentFilter is:

    [IntentFilter(new [] {Android.Content.Intent.ActionView }, 
        DataScheme="*", 
        DataHost="jakubsapp",
        DataPath="login",
        Categories=new [] { Android.Content.Intent.CategoryDefault })]
    

    Your Scheme is set to *
    Your Host is set to jakubsapp

    The url you provide on your webpage is: jakubsapp://login

    In that case the Scheme is jakubsapp, Host is login.

    You need to be more consistent.

  • JakubHolovskyJakubHolovsky CZMember

    @Cheesebaron yep, agreed, sorry, I missed that url.

Sign In or Register to comment.