Dynamic links do not work properly on Facebook and Facebook Messenger apps on Android

3,337 views
Skip to first unread message

Radek Bartoň

unread,
Jan 4, 2017, 10:28:34 AM1/4/17
to Firebase Google Group
Hello everyone.

We have integrated Firebase Dynamic Links to our Android app according to this documentation https://firebase.google.com/docs/dynamic-links/ . It works properly on any application I have tested (Slack, Twitter, Google+, etc.) except when shared on Facebook or Facebook Messenger.

First we create a deep link to our Android app:

new Builder()
 
.scheme("https")
 
.authority("winged-guild-133523.appspot.com")
  .appendPath("share")
  .appendQueryParameter("query", query)
 .build();

Then we create a long dynamic link:

new Builder()
 
.scheme("https")
 
.authority("zkkf4.app.goo.gl")
  .appendPath("")
 
.appendQueryParameter("link", deepLink)
  .appendQueryParameter("apn", "com.example")
  .build();

Then we create short URL from the dynamic link at https://firebasedynamiclinks.googleapis.com/v1/shortLinks and share it using:

Intent intent = new Intent(Intent.ACTION_SEND);
intent
.setType("text/plain");
intent
.putExtra(Intent.EXTRA_TEXT, shortUrl);
startActivity
(Intent.createChooser(intent, null));

When the short URL is shared on Facebook Timeline using Facebook app:
  • The short URL is properly shared.
  • When I click on the post in Facebook app and application is not installed, the Google Play app is properly displayed and after installing the app the deep link is properly handled.
  • When I click on the post in Facebook app and application is already installed, the Google Play app is opened instead of our app and after clicking on open button, the deep link is not passed to the application because it is not possible to pass referrer information to the app when no installation was performed.
When the short URL is shared in Facebook Messenger message:
I see three problems here:
  1. Facebook app is not properly detecting that application is installed.
  2. Facebook Messenger app is sharing the long dynamic link instead of the short one.
  3. Facebook Messenger app is opening the long dynamic link instead of Google Play.
Do anyone please have any clue what is going on and how to solve those problems?

PS: Although it is irrelevant because deep links handling is working fine, this is how intent filter in Android manifest looks like:

<activity
  android:name="MainActivity"
  >
 
<intent-filter>
   
<action android:name="android.intent.action.MAIN"/>
   
<category android:name="android.intent.category.LAUNCHER"/>
 
</intent-filter>

 
<intent-filter android:label="@string/app_name">
   
<action android:name="android.intent.action.VIEW"/>
   
<category android:name="android.intent.category.DEFAULT"/>
   
<category android:name="android.intent.category.BROWSABLE"/>
   
<data android:scheme="http"/>
   
<data android:scheme="https"/>
   
<data android:host="winged-guild-133523.appspot.com"/>
   
<data android:host="www.winged-guild-133523.appspot.com"/>
   
<data android:pathPattern="/share.*"/>
 
</intent-filter>
</activity>

Radek Bartoň

unread,
Jan 5, 2017, 10:01:17 AM1/5/17
to Firebase Google Group
Reply all
Reply to author
Forward
0 new messages