Search code examples
javaandroiddeep-linkingfirebase-dynamic-links

Opening Firebase Dynamic Link with android app without FirebaseDynamicLinks


I have an application at the Google Play and there are already a few hundred of users.

Now, I'm working on an update that will allow users to share user-to-user content via Firebase Dynamic Links.

In order to do so, I created a subdomain and all the required things and I added this code:

FirebaseDynamicLinks.getInstance()
                .getDynamicLink( getIntent() )
                .addOnSuccessListener( this, pendingDynamicLinkData -> {
                    Uri deepLink = null;
                    if (pendingDynamicLinkData != null) {
                        deepLink = pendingDynamicLinkData.getLink();
                        String bookID = deepLink.getQueryParameter( "id" );
                        if (bookID != null) {
                            startBookDetailActivity( bookID );
                        }
                    }
                } )
                .addOnFailureListener( this, e -> {
                        }
                );

However, the users who already have the app installed on their phone don't have this piece of code in their application which means that if they click on the dynamic link it won't do the job.

Is there any other way I can handle the dynamic link for the period until all users get the latest version?

Thank you


Solution

  • You could have the user copy and past the code into the app but ultimately, this also requires that the app is updated to do so.

    Perhaps you could use a cloud function that would return the data in the browser rather than the app, you could do this with a button that appears after a second and manually invoke the call.

    But it might just be easier to encourage users to update and implement a callback system using real-time or firestore as a user inbox system for this kind of edge case.