What is a dynamic link?
A Dynamic-link is a smart link that provides the best user experience on your native app such that you can control the specific location of the application to where the user should be redirected to. By using dynamic links, if the user does not install the specific app on their mobile phone and if the user opens the link through a mobile phone you can redirect the user to the Android Play Store or Apple Store by forcing to install the specific app to their mobile phone. And if not an app is already on the user’s mobile phone then the user will redirect inside the app-specific location.
In this article, the usage of the dynamic link will implement using Flutter and Firebase.
In this case, we will provide a solution with a programmatically easiest way such as user redirects to a specific page when the app is installed to their mobile phone. To make clear deep link creation and its purpose, there is a dummy project with three pages the home page, login page, and profile page. The home page is the initial page and if the app is trying to open with a deep link it will redirect to the login page.
You need to have an existing flutter project or create a new flutter project using flutter create <Your Project Name>
command.
Then there is a plugin called “firebase_dynamic_links” and add it to your created project’s pubspec.yaml file.
This plugin will help to detect firebase dynamic links in our application.
firebase_dynamic_links: ^2.0.6
Let’s go with following steps………..
First setup project in firebase console. To setup , see my articale Google Sign-In & Firebase Authentication Using Flutter.
After successfully adding google-services.json and google-services.plist file to your app folder, you need to add Firebase SDK setup in native apps.
Now we have successfully initial configuration and adding Firebase to our existing project. Then we will move on to the next step.
Setting up Firebase
On the right side of the Firebase console, select “Dynamic Links” after redirecting to your firebase flutter dynamic link project. Then click “Get started”.