0
votes

We are developing Facebook AppLinks for Android.

We followed all the directives from Facebook Developer page:

https://developers.facebook.com/docs/applinks/add-to-content https://developers.facebook.com/docs/applinks/android

  1. In our Web page (the target url) we define the metas:
  <meta property="al:android:url" content="mySchema://?id=3643020" />
  <meta property="al:android:app_name" content="myAppName" />
  <meta property="al:android:package" content="com.my.package" />
  <meta property="al:android:class" content="com.my.package.screens.BrowseableActivity"/>

inside the tag.

For the Schema, we also tried with this one:

  <meta property="al:android:url" content="mySchema://id=3643020" />

    (without the ? character)
  1. In our Android App, in the Manifest for the BrowseableActivity we define:

    <activity android:name=".screens.BrowseableActivity" 
        android:theme="@style/Theme.myAppName.myTheme" >    
         <intent-filter>
            <action android:name="com.my.package.screens.BrowseableActivity" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter> 
        <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:scheme="mySchema"/>
        </intent-filter>      
    </activity> 
    

When we test:

  1. We share from our App a link to Facebook, where the "link" property is the 'target url' that has the metas. That is ok.

  2. Inside the Facebook Android App (version 18.0.0.24.14) we see the post shared in the previous step.

  3. We click on the post, and our App is open! Everything is ok until here.

OUR PROBLEM:

According to Facebook documentation in the Intent that opens our "BrowseableActivity", the 'data' field should have the following information:

data: "mySchema://id=3643020?target_url=http%3A%2F%2Fwww.ourtargeturl.com%2Fdirectory"

this is: the Schema (Uri or Android Url) and the Target_url

But for us, we only got this:

data: "http%3A%2F%2Fwww.ourtargeturl.com%2Fdirectory"

We only got the target_url.

In this page of Facebook ( https://developers.facebook.com/docs/applinks/android ) they said that if you don't receive 'the Schema' if because you don't define the meta "al:android:url" in the target_url. But, we define it.

Also, in the others fields of the Intent, (the extras x example) we don't see 'the Schema' information.

And that info is what we need, and we don't know what else to try.

Thanks,

1
Where did you define the id in mySchema://?id=3643020?erdomester
The id is a product id that is the same for our website and app. That uri is defined server side on our website and printed out in meta tags in the html of the product page.Maria Del Valle Duhagon

1 Answers

2
votes

Don't specify the class name. If you specify the class name, it will use the package name/class name combination to create an intent with a componentName that directly addresses your app/activity. What goes in the "data" field is actually undefined at that point.

If you skip specifying the al:android:class property, then it will use your custom url.