Firebase Dynamic Links in Facebook

Aung Myint Thein
MyanLearn: Blog
Published in
3 min readFeb 28, 2020

We use React Native Firebase Dynamic Links to deep link into our application but Facebook’s Mobile Browser giving us issues.

My best understanding and our workflow of Dynamic Links
  1. Our nodejs backend will call Firebase API to create dynamic links.
  2. Firebase will give us a dynamic link.
  3. We post or share the link in Facebook, and other social media.
  4. People click on the link on the media in our case is Facebook.
  5. Facebook Mobile Browser will open the link.
  6. Depending on the device and configuration in the link, iOS, Android App, or website will be opened.

Make sure your SHA256 fingerprints are in Firebase Console. You can get both your dev fingerprint and Google Play Store’s key in Play Store > Release Management > App Signing and put them in Firebase > Project Setting > Android Apps > SHA Fingerprints.

It is all supposed to be working fine but it is not. There can be a few possible places. 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.

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)

Environment:
React Native — 0.61.4
React-native-fbsdk — 1.1.2
react-native-firebase — 5.5.6

After more investigation, I found out that the issue is in Firebase SDK to generate dynamic link short links. If there are `socialMetaTagInfo` data, the link is going to be broken and Facebook Mobile Browser will open web page. However, if there is no data for `socialMetaTagInfo` section, the link will work as intended.

Actually, after more and more investigation and testing, I found out that

a) 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.

b) 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.

Hope this will help some of our fellow developers trying to solve Firebase Dynamic Links not opening in Facebook’s feed issues. Hope this post will save some of your hairs! Please let me know if you have issues and happy to help!

This post is written on 28 Feb, 2020 and with my best investigation. Reference Github issue is here: https://github.com/firebase/firebase-android-sdk/issues/916

--

--

Aung Myint Thein
MyanLearn: Blog

Co-founder, CTO of a Myanmar EdTech startup www.myanlearn.com. Interested in data, statistics, programming, and psychology. Writing down codes and thoughts.