firebase-android-sdk: 157238998: Dynamic link not working with facebook

Facebook (the most popular social app.) uses special head meta tag to convert page to dynamic link. Without this tag it opens the link in the ‘inAppBrowser’. Is there is way go integrate firebase dynamic links with facebook.

<meta property="fb:app_id" content="your_fb_app_id" />

<meta property="al:android:package" content="com.your.package" /> <meta property="al:android:app_name" content="YourAwesomeApp" /> <meta property="al:android:url" content="somescheme://XYZ" /> <!-- identifiable by your app, your app must handle this data scheme inside your manifest's intent-filter tag --!> <meta property="al:web:should_fallback" content="true" /> <meta property="al:web:url" content="http://www.yourwebsite.com/" />

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 16
  • Comments: 85 (5 by maintainers)

Most upvoted comments

@manu89ft sorry I really don’t know how long it will take.

Guys, since nobody from the Firebase team reacts to this two other issues about Dynamic Links not working (properly) in Facebook app, I contacted Firebase through their support. This is the response I got:

Just wanted to let you know that we are aware that Dynamic Links don’t work well with Facebook. Unfortunately, we don’t have a workaround for this issue, as it’s up to Facebook to determine how URLs are handled inside their app. The only suggestion I can provide would be to ask your users to open your links from a non-Facebook browser. Hope you understand.

So, don’t expect any fixes from Firebase and deal with the issue accordingly…

@mikehardy was probably the intended mention

any updates. our firebase links in Facebook / insta are NOT working anymore…why?? they work fine everywhere else please fix… but for short term…

what privacy settings on Facebook can be changed to allow our links to start working iagain??

Sorry about the slow response, will look into this!

one more month? any way to fix this?

On Android, through facebook App, if i open a shared dynamic link, It is not working, In OnSuccess listener Callback, (PendingDynamicLinkData pendingDynamicLinkData)
pendingDynamicLinkData is coming as Null, So not able to retrieve deep link in the App. Kindly suggest or fix this issue,

WorkAround: I could make it work by changing the Facebook privacy settings for enabling to open the link externally. then i could get the desired results. But this is not the correct way , As we can not force user to change the privacy settings of facebook.

Guys you just need to skip the social meta details (Step#5) when you are creating a dynamic link from the Firebase console.

You just need to remove this meta if you are creating a dynamic link for Facebook AD.

If you are creating a dynamic link by using REST API then there you just need to remove socialMetaTagInfo or you can skip the complete dynamicLinkInfo.

I’ve attached the image for you reference you guys can check.

Generate Dynamic Link Using Firebase Console

Firebase Dynamic Link - Console

Generate Dynamic Link Using REST API

Firebase Dynamic Link - REST API

⚠️ Note :

  • This is only for the Facebook AD.
  • You need to create a new link if you have already created, due to caching issue.

Give 👍 or 🎉 if this works for you. 😉 Thanks & Happy Coding 🍻

Actually, I found out that

without social meta tag, iOS won’t work but Android will work. (eg: https://myanlearn.page.link/Cg29UhebgBRimiT48) This link will open my app in iOS without preview page (not sure why it skipped) but won’t deep link into the content. Android is working fine.

with social meta tag, iOS will work but Android won’t work. (eg: https://myanlearn.page.link/UF3RFFrALVGgPGYt6) Preview page is shown in iOS and deep linked into the content. Android won’t open the app.

For me short dynamic links on android on facebook do not work with or without social meta tags! It simply leads to the app on the play store but does not open the app even if it is installed!

I have also encountered another issue where dynamic links from other app on android only work if you have chrome browser open otherwise It simply leads to the app on the play store but does not open the app even if it is installed!

On android deep linking only works if browser is already open! Though I have tested your link and it is working fine.

My conclusion is that besides social meta tags issue, there is also some other configuration issue which might be causing this! I am not sure…

Hello @dngconsulting,

I’ve worked on this issue and found that many people are facing the same issue. So I found one solution which will work with your facebook or social media and campaigns. I’ve used the concept of firebase & universal link. I’ve used this technique in my live projects and tested for a 1 Month and we didn’t found any issue. Given solutions is tested and trusted by me and my team on live projects.

I’ve written a blog with code snippets so you guys are check the details and share your feedback. If you have any problems in implementation do let me know, I’ll try to help out.

Link : Google Dynamic Links

#help #firebase #facebook #codezma #blog #code #snippets

Ok, this behaviour suit your specific needs but not the common case which consist to use the same link for all platforms. Our users choose to share on facebook/whatsapp or any other platform, we simply can’t propose specific links for facebook and other for whatsapp/instagram. Those links should work on facebook with social meta tags or not. But I understand that it’s more a facebook issue than a firebase one.

Running into the same issue on Android. Posting a short link in the Facebook app always goes to the Play Store even if the app is installed. If the app is not installed, when installing it, it does not have the deep link.

I did some investigation and this is what I found out so far.

TLDR: Firebase Dynamic Link SDK might be having an issue. Facebook In-App Mobile Browser for Android is definitely having issue in redirecting in my experience.

Scenario 1. Long link - Android working, iOS partially broken.

I create a dynamic link manually. So, it is a long link such as “https://myanlearn.page.link/?link=https://www.myanlearn.com/course/607138951&apn=com.myanlearn_for_students&isi=1441239224&ibi=com.myanlearn.myanlearnforstudents”. Posted the link on my Facebook Feed. When I open it in Android, my app is opened immediately and deep link is working as intended. When I open in iOS, the app is opened but deep link is not working. Surprisingly, no preview page is loaded in both iOS & Android.

Scenario 2. Short link - Android (FB Mobile Browser) not working, iOS working.

Then i create a dynamic link through REST API and got a link such as “https://myanlearn.page.link/vVp9eoQHnMSBLWxA6”. Posted the link on my Facebook Feed. When I opened it in Android, Facebook’s Mobile Browser tried to open my link and it opens “Play Store” page (if no fall back link androidFallbackLink is provided) OR opens fall back web link (if androidFallbackLink is provided). When I open in iOS, the preview page is loaded. Then my app is opened and deep link is working as intended. I tested the short link in all the other apps in Android and they are all working fine. So, I guess the way FB Mobile Browser is handling the link is broken somehow OR Firebase’s detecting + directing is broken somehow in FB Mobile Browser.

Tested iOS: iPhone 6, iPhone 11 Android: OnePlus 2 (Android 6.0), Mi F1 Pocco (Android 9.0)

Hope this helps to find the issue and hopefully the fix…

How you configure the link in scenario 1 to open in facebook’s feed without set “Open external link” in Setting? I tried configure my own dynamic link manually on Firebase Console but when I click it in Facebook’s Feed ,it redirected to Play Store instead of my app (I tested on Android and don’t open external link on Facebook). May you explain your own way? I would appreciate it

I am also facing the same issue for Facebook and Skype. Platform: Android

I have the same problem with dynamic link on facebook but it works fine on messenger, and on Viber it does not show my image it shows firebase logo.

can anyone help ? because i really need that my dynamic links to be opened from facebook but what i get it redirect user to firebase url and then ask user to open play store after that when clicking on play store icon it open the app.

as a temporary workaround, I suggest to use this answer and s this

We are in 2022 and same issue. What I don’t understand is that I can easily deeplink google photos or any other google app in Facebook without any issue. Looks like google doesn’t use dynamic links for their own apps…

@samtstern this still seems to be an issue over 1.5 years after it was reported, is there anybody that should be tagged to look into this?

I was able to get it to work for iOS by adding the appropriate metadata to our website’s main page’s header (used as the dynamic link URL set in Dynamic Links editor) as referenced here https://developers.facebook.com/docs/applinks/metadata-reference/

What about android? it redirects me to google play instead of the URL ( website ) so using metadata not helpful

Yes @mikehaney24 that could be done without problem, I didn’t knew about firebase functions, but as I read the documentation I think it works that way too.

I didn’t think about using serverless because I didn’t had another custom domain to use and I used a site that was already being served under nodejs.

Anyways, this solution is more like a patch to what firebase dynamic links is lacking in functionality, and this should be working out of the box without a problem.

Hi, I recently had to integrate dynamic links to one of my clients apps, and I got lots of trouble because of deeplinks not working on facebook+android_app.

As I couldn’t move to branch.io because of princing reasons, I had to work it out on a different way so I read this issue on stackoverflow: https://stackoverflow.com/a/41592330. (more or less it says to put a proxy link between the client and the dynamic link itself where you should put the necessary facebook applinks metadata, and a redirect to the dynamic link itself for other types of clients)

I tried it with a hardcoded link and it worked very well (it opened the app instantly), so then I found out that I only needed to send via query string the link ID and another info to build some other metadata like og:title, og:description and og:image for the link preview to work well.

I ended with a very simple nodejs+express setup where I receive the dynamic link ID and return a HTML with all the meta-tags required by facebook applinks (android + iOS) and a redirect script (window.location = <dynamic_link>) for other clients to be used.

The best part is that now on facebook the app opens directly without the preview page in both platforms and the link works on all browsers via the script redirect.

Here is the gist: https://gist.github.com/rsevil/377690cef7bde5fe6825e3d248af035d

Ok @joshwolff1 i’ll also try that than.

Same here! Found that when the activity handler is called from Facebook, the intent.getData() brings the right URL, but there’s an “extra” missing called “com.google.firebase.dynamiclinks.DYNAMIC_LINK_DATA”

It’s a byte[296] object with an unknown information, present when I use the link without Facebook.

now I can’t even post dynamic links on Facebook or share via Facebook Messenger app, anyone?

any updates ?

Same problem here too

From 5 days our links are broken in Facebook and Instagram Webview… For example https://dyn.bantoa.com/rniX

Here you will find two screencasts: https://we.tl/t-IvB5aYtKfv