Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook on Android: target app doesn't open when clicking on link

I included the proper app links metatags in the HTML, so that by clicking on that link on Facebook the Android and iOS apps would open with the correct content.

This is an example of page: https://trenit.info/L2o

<meta property="al:ios:url" content="https://trenit.info/L2o" />
<meta property="al:ios:app_store_id" content="1058908183" />
<meta property="al:ios:app_name" content="Trenit!" />
<meta property="al:android:url" content="https://trenit.info/L2o" />
<meta property="al:android:app_name" content="Trenit!" />
<meta property="al:android:package" content="eu.baroncelli.oraritrenitalia" />

I published that link on Facebook, and I have installed the Trenìt! app in both my Android and iOS devices.

on iOS:
if I use the Facebook app and click on that link, the Trenìt! iOS app opens correctly with that content.

on Android:
If I use the Facebook app and click on that link, the HTML page opens instead of the Trenìt! Android app.

am I doing something wrong?

Please note, on the Android manifest I have already specified this 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="https" android:host="trenit.info" />
        </intent-filter>
like image 646
Daniele B Avatar asked Oct 29 '22 14:10

Daniele B


1 Answers

I have recently implemented same functionality in my app and it's working correctly.

As per Facebook documentation your tags in the website page are not correct, for android it should be like this

<meta property="al:android:url" content="trenit://L2o/*" />
<meta property="al:android:app_name" content="Trenit!" />
<meta property="al:android:package" content="eu.baroncelli.oraritrenitalia" />

and in your manifest it should be like this

       <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="trenit" />
        </intent-filter>
like image 143
Adeel Javed Avatar answered Nov 09 '22 09:11

Adeel Javed