Facebook on Android: the target application does not open when you click on the link

I have included the appropriate link meta tags in the HTML, so that by clicking on this link on Facebook, the Android and iOS applications will open with the correct content.

This is an example 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 posted this link on Facebook and I installed Trenìt! application on both Android and iOS devices.

on iOS :
if I use the Facebook application and click on this link, Trenìt! The iOS application opens with this content.

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

Am I doing something wrong?

Please note: in the Android manifest, I 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> 
+6
source share
3 answers

I recently implemented the same features in my application and it works correctly.

According to the Facebook documentation, your tags on the site page are incorrect, for android it should be like

 <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

  <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> 
+2
source

In an Android application, in order to open the application from an external link / sms .., you must use the deep link in your application. so that your application will be shown in the launch selection dialog where you can select your application to open
Please follow the developer links below.
https://developer.android.com/training/app-indexing/deep-linking.html

This is below xml for understanding only. Please change accordingly

<activity android:name="--YourActivityName--" android:label="--your app lable--" > <intent-filter android:label="@string/filter_title"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <!-- Accepts URIs that begin with "https://trenit.info/L2o" --> <data android:scheme="https" android:host="trenit.info" android:pathPrefix="/L2o" /> </intent-filter> </activity> 
+1
source

Create a separate intent filter for activity, as shown below.

  <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <data android:scheme="schemIncludedInMetaTag"></data> </intent-filter> 
0
source

Source: https://habr.com/ru/post/1013759/


All Articles