How do I receive query parameters from Firebase Dynamic Links using react-native-firebase?

Viewed 5118

I've followed the instructions from the official react-native-firebase documentation and everything, as per the instructions, works fine.

It is my understanding that I should be able to create a link like the following in the Firebase Dynamic Links console: https://myapp.page.link/offer?offerid=123456 and be able to receive the offerid parameter in my app. However, when I click that link (in the iOS simulator, Android emulator, and on a real device) the app opens, but I just get a link with the following data:

Received initial link {"minimumAppVersion": null, "url": "https://mysite.co/offers"}

There are no query string parameters attached. Am I missing something in the Firebase Dynamic Link configuration? Or in my implementation of react-native-firebase that was not covered in the documentation linked above? Or is this actually just not possible?

1 Answers

I think you are confusing deep links with dynamic links. Dynamic links handle your deep links to content depending upon the platform.

Example you have a deep link: https://example.com/offer?offerid=123456 . You wish to open it in your app depending upon the platform.

Suppose you created a domain for dynamic link from console: https://myapp.page.link

Now you can create a dynamic link which opens the deep linked content on your app. The dynamic link can take in only specific parameters as mentioned here. However you can pass your parameters to your deep link,

https://myapp.page.link/?link=https%3A%2F%2Fexample.com%2Foffer%3Fofferid%3D123456&apn=com.example.app&ibi=com.example.app

The above dynamic link opens the deep link in your android app with package name com.example.app and ios app with bundle ID com.example.app.

Related