Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Dynamic Links - Can't get Url in android after install app from play store

If I install the app when clicking the dynamic link. All of that information from dynamic should be still available when I open the app for the first time.How can I get that information? It is not working when I use this: getInitialLink() returns Promise<string|null>;

like image 531
ian sembiring Avatar asked Jul 05 '18 10:07

ian sembiring


People also ask

How do I get data from Firebase dynamic link?

To receive the Firebase Dynamic Links that you created, you must include the Dynamic Links SDK in your app and call the FirebaseDynamicLinks. getDynamicLink() method when your app loads to get the data passed in the Dynamic Link.

How do I open a dynamic link?

Enable Firebase Dynamic Links for your Firebase project in the Firebase console. Then, include the Dynamic Links SDK in your app. You can create Dynamic Links programmatically or by using the Firebase console. When your app opens, use the Dynamic Links SDK to check if a Dynamic Link was passed to it.

Do Firebase dynamic links expire?

The created short Dynamic Link will not expire. Repeated calls with the same long Dynamic Link or Dynamic Link information will produce the same short Dynamic Link. The Dynamic Link domain in the request must be owned by requester's Firebase project.


1 Answers

Since, you haven't mentioned - I'm assuming you are having problems with shorter urls, if that's the case try putting the longer url.

Or refer here on Simon's answer: When I use the long instead of short links, everything works perfectly fine.


On Android, you use the getInvitation() method to get data from the Dynamic Link:

AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).setResultCallback
(/* ... */);

Then, in the callback, you can get the data passed in the Dynamic Links link parameter by calling the getDeepLink() method:

Firebase Documentation - Use Case


For future reference or detailed answer on Firebase Dynamic Links

Behave just like normal Links

In cases where the application doesn’t require installation (say, if it’s already installed) then clicking the Dynamic Link will automatically open the link to the desired screen.

Dynamic Links have a very simple process flow:

  • The user begins by clicking the Dynamic Link
  • If the the needs of the Dynamic Link target are satisfied (this is, the application being installed) then the user is navigated to the target location
  • Otherwise, if the application requires install in order to navigate to the Dynamic Link target, the the user is taken to the point of install for the application. Once the application has been installed, the user is navigated to the target location of the Dynamic Link

Dynamic Links process flow

And if that wasn’t all, we can integrate Dynamic Links with Firebase Analytics to track the interaction with any links that we generate for our applications. But if we only require simple tracking, then we can use the automatic built-in analytics from the Dynamic Links panel within the Firebase Console where we can also obtain attribution and referrer information for interacted links with no extra effort required from our side.

What makes it different from Google Analytics?

One of the first things that came to my mind when I read about Firebase Analytics was, “What about my Google Analytics setup?”. So if you already have Google Analytics in place, then why would you make the switch to Firebase Analytics? Well, here’s a couple of differences between the two:

Audiences

We can use Firebase Analytics to create Audiences — these are groups of users that we can then interact with using other Firebase service such as Firebase Notifications and / or Firebase Remote Config.

Integration with other Firebase Services

An awesome thing with Firebase Analytics is that we can integrate other Firebase services with analytics. For example, creating an Audience of users who have experienced a crash reported through Firebase Crash Reporting.

Lower Method Count

The Google Analytics dependency on Android has a total count of 18,607 methods and has a total of 4kb used for dependancies. On the other hand, Firebase Core (for Analytics) has a method count of 15,130 and only 1kb used for dependancies.

Automatic Tracking

When we add the firebase core dependency, it will automatically begin tracking a collection of user engagement events and device information for us — this is useful if you’re looking to only collect the minimal data for your app.

Unlimited Reporting

For up to 500 events, Firebase Analytics provides us with unlimited reporting straight out of the box for free!

No Singleton Initialisation

When setting up Google Analytics on Android we are required to initialize a Singleton instance. Firebase Analytics are simply available by fetching the instance directly from where we wish to track data. This isn’t much effort obviously but just makes the setup flow slightly easier.

Single Console

All of the data for every Firebase service is available for a single console. That makes it both easier and quicker for us to navigate from checking the analytic stats for our app to viewing the latest crash reports.

like image 174
Rohit Sharma Avatar answered Oct 19 '22 17:10

Rohit Sharma