You can add extra parameter to your link to generate Short URL from Firebase.
Here I given example of Short URL generation using Firebase API.
Here ServiceRequestHelper(this).PostCall is my generic class to make API request
String url = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=YOUR_KEY";
    try {
        PackageManager manager = this.getPackageManager();
        PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
        JSONObject jsonObject = new JSONObject();
        JSONObject androidInfoObject = new JSONObject();
        androidInfoObject.put("androidPackageName", getApplicationContext().getPackageName());
        androidInfoObject.put("androidMinPackageVersionCode",String.valueOf(info.versionCode));
        JSONObject iosInfoObject = new JSONObject();
        iosInfoObject.put("iosBundleId", "tettares.Test_ID");
        JSONObject dynamicLinkInfoObj = new JSONObject();
        dynamicLinkInfoObj.put("dynamicLinkDomain", "wgv3v.app.goo.gl");
        dynamicLinkInfoObj.put("link", "https://test.in/?UserId=14&UserName=Naveen");  // Pass your extra paramters to here
        dynamicLinkInfoObj.put("androidInfo", androidInfoObject);
        dynamicLinkInfoObj.put("iosInfo", iosInfoObject);
        JSONObject suffixObject = new JSONObject();
        suffixObject.put("option" , "SHORT");
        jsonObject.put("dynamicLinkInfo", dynamicLinkInfoObj);
        jsonObject.put("suffix", suffixObject);
        Log.d("JSON Object : " , jsonObject.toString());
        new ServiceRequestHelper(this).PostCall(url, jsonObject, false, new CallBackJson() {
            @Override
            public void done(JSONObject result) throws JSONException {
                try {
                    if (result.has("shortLink")) {
                        DEEP_LINK_URL = result.getString("shortLink");                                                   }
                } catch(Exception e)
                {
                    e.printStackTrace();
                }
            }
        });
    } catch (JSONException | PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
In Your Receiving Activity:
boolean autoLaunchDeepLink = false;
    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
            .setResultCallback(
                    new ResultCallback<AppInviteInvitationResult>() {
                        @Override
                        public void onResult(@NonNull AppInviteInvitationResult result) {
                            if (result.getStatus().isSuccess()) {
                                // Extract deep link from Intent
                                Intent intent = result.getInvitationIntent();
                                String deepLink = AppInviteReferral.getDeepLink(intent);
                                // Handle the deep link. For example, open the linked
                                // content, or apply promotional credit to the user's
                                // account.
                                // [START_EXCLUDE]
                                // Display deep link in the UI
                                Log.d(TAG, "deeplink URL: " + deeplink); // Here you get https://test.in/?UserId=14&UserName=Naveen
                                // [END_EXCLUDE]
                            } else {
                                Log.d(TAG, "getInvitation: no deep link found.");
                            }
                        }
                    });