I am working on invites in my app, I want users to refer others, the referrer will get a reward after the person they referred registers. I was following this firebase invite tutorial, in step 2 we created a dynamic link from our normal link with our parameter invitedby=SENDER_UID like
String link = "https://samplelink.com/?invitedby=" + user.getPhone(); Log.e(TAG, "Generated link: "+link); FirebaseDynamicLinks.getInstance().createDynamicLink() .setLink(Uri.parse(link)) .setDynamicLinkDomain(getString(R.string.dynamic_link_domain)) .setAndroidParameters( new DynamicLink.AndroidParameters.Builder(getPackageName()) .build()) .setIosParameters( new DynamicLink.IosParameters.Builder("com.example.ios") //.setAppStoreId("123456789") // .setMinimumVersion("1.0.1") .build()) .buildShortDynamicLink() .addOnSuccessListener(shortDynamicLink -> { Uri mInvitationUrl = shortDynamicLink.getShortLink(); Log.e(TAG, "generated URL: "+mInvitationUrl.toString()); Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invite_and_earn)) .setMessage(getString(R.string.invitation_message)) .setDeepLink(mInvitationUrl) // .setCustomImage(Uri.parse(getString(R.string.invitation_custom_image))) // .setCallToActionText(user.getPhone()) .build(); startActivityForResult(intent, REQUEST_INVITE); }).addOnFailureListener(e -> Log.e(TAG, "Error Generating Deeplink: "+e.getLocalizedMessage())); }); And sent the generated short dynamic link. When the users opened the app in step 4 we got the link like
FirebaseDynamicLinks.getInstance() .getDynamicLink(getIntent()) .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() { @Override public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) { // Get deep link from result (may be null if no link is found) Uri deepLink = null; if (pendingDynamicLinkData != null) { deepLink = pendingDynamicLinkData.getLink(); } // // If the user isn't signed in and the pending Dynamic Link is // an invitation, sign in the user anonymously, and record the // referrer's UID. // FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user == null && deepLink != null && deepLink.getBooleanQueryParameter("invitedby")) { String referrerUid = deepLink.getQueryParameter("invitedby"); createAnonymousAccountWithReferrerInfo(referrerUid); } } }); The link does shorted dynamic link generate fine, and sent, if opened in the browser the original https://samplelink.com/?invitedby=" + user.getPhone() displayed but in the app I only get the shortdynamiclink so invitedby is never found. Anyone had this issue?
A sample of my short dynamic link