0

I have searched SO and the web for a similar issue, and while others appear to have encountered this problem, their solutions are not working for me.

DFL parameter in Firebase Dynamic Links Builder

Starting with Android, I'm attempting to implement the Dynamic Links for my app. The app requires additional parameters on the dynamic link, so I'm manually constructing the link based on the information here: https://firebase.google.com/docs/dynamic-links/create-manually.

I have created my link in the following manner (code abbreviated for purposes of this post)

Uri.Builder builder = new Uri.Builder() .scheme("https") .authority(AppPrivate.Invitation.APP_CODE + ".app.goo.gl") .path("/") .appendQueryParameter("link", link) .appendQueryParameter("apn", AppPrivate.PACKAGE) .appendQueryParameter("dfl", desktopLink); 

For my use case the link and desktopLink parameters are the same - they are actual working URLs on my website. Regardless of what device the user hits with the dynamic link, it should perform the desired action. Again, for purposes of simply getting this working, I've linked to our primary website (https://www.mytravelerapp.com).

When I send the invitation from my Android device, I generate an intent based on the code sample here: https://github.com/firebase/quickstart-android/blob/master/invites/app/src/main/java/com/google/firebase/quickstart/invites/MainActivity.java

return new AppInviteInvitation.IntentBuilder(context.getString(R.string.content_trip_invitation_title)) .setMessage(message) .setDeepLink(uri) .setCustomImage(Uri.parse(AppPrivate.Invitation.TRIP_INVITE_DEEP_LINK_IMAGE)) .setCallToActionText(context.getString(R.string.content_trip_invitation_cta)) .build(); 

However, when I receive the invitation via email on my desktop, it always goes to the Play Store listing, no matter what I've added to the initial deep link (DFL, AFL). Here's a sample of the link from the "call to action" button from the email:

https://a3d4u.app.goo.gl/i/225742434763-3bd2c2fa-45f0-4ed8-aca3-37760d27d971

I've not yet implemented the receivers in the android app to listen for incoming links, so I cannot confirm whether or not the deep link behaves appropriately on that platform.

Any recommendations or suggestions on what I'm missing with the desktop link are greatly appreciated.

Thanks!

1 Answer 1

1

You're actually wrapping a dynamic link in another dynamic link. Invites itself generates a dynamic link, which doesn't have your DFL parameter, so it is redirecting to the store.

You could try shortening the dynamic link you generate, and sharing via the regular share dialog rather than using Invites.

Sign up to request clarification or add additional context in comments.

4 Comments

Ah, so if you use the manual approach to generating the dynamic link then you don't need to use the AppInviteInvitation intent builder? Then, as you mentioned, you just call the regular share intent for apps available on the user's individual device ? So it could technically go out to social media channels, email, SMS, etc? Thanks for the clarification - didn't quite make that connection when reading the specs. That also explains why the activity wouldn't answer up to my host - I had to use the app_code.app.goo.gl host rather than my .com.
Quick follow-up - if I eliminate the AppInviteInvitation builder and simply send the Uri constructed from manually creating the dynamic link, I get a Google 400 error. Here's the link it creates (once I get something working, I'll shorten it) - a3d4u.app.goo.gl/…
Please append &d=1 to the link to see debug page. Here a3d4u.app.goo.gl/… you can see that something is wrong with link parameter (deep link). Try this one instead a3d4u.app.goo.gl/?link=https%3A//…
The encoding is causing issues - I guess I'll drop the AppInviteInvitation intent builder and just construct the URL with the encoding you referenced with the working link. The Firebase docs don't quite seem clear on the manual link approach. Thanks for the help.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.