Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the app code used to create the URL deep link in Firebase for Android

I am trying to use Firebase Dynamic Links in my Android app. I'm confused on one of the parameters used to build deep links.

In the demo app, it calls an api to create a URI to be used as a deep link. As part of that it uses a "app code" as part of the authority method.

public Uri buildDeepLink(@NonNull Uri deepLink, int minVersion, boolean isAd) {
    // Get the unique appcode for this app.
    String appCode = getString(R.string.app_code);

    // Get this app's package name.
    String packageName = getApplicationContext().getPackageName();

    // Build the link with all required parameters
    Uri.Builder builder = new Uri.Builder()
            .scheme("https")
            .authority(appCode + ".app.goo.gl")
            .path("/")
            .appendQueryParameter("link", deepLink.toString())
            .appendQueryParameter("apn", packageName);

    // If the deep link is used in an advertisement, this value must be set to 1.
    if (isAd) {
        builder.appendQueryParameter("ad", "1");
    }

    // Minimum version is optional.
    if (minVersion > 0) {
        builder.appendQueryParameter("amv", Integer.toString(minVersion));
    }

    // Return the completed deep link.
    return builder.build();
}

My questions is, what is the app code and where do I get it?

like image 772
JustLearningAgain Avatar asked Jan 08 '17 03:01

JustLearningAgain


People also ask

How do I create a deep link URL?

Adjust Deeplink Generator To use the tool, log in to your Adjust dashboard and open the Menu, where you'll see the 'Deeplink Generator' as an option. Click to open, and you'll find a page to input the information required to create your deep link.

How do I get my Firebase link?

Go to Database section. Tap Cloud Firebase (marked 1 in picture) and select Realtime Database. Marked 2 is the URL.

What is deep link in Firebase?

Deep links that survive the install process Dynamic Links are smart URLs that allow you to send existing and potential users to any location within your iOS or Android app. They survive the app install process, so even new users see the content they're looking for when they open the app for the first time.


1 Answers

Step 1 : include the following in the build gradle and sync the project

compile 'com.google.firebase:firebase-invites:10.0.1'

Step 2 :

Open your project in firebase console and then click on the deep link section and at the top of the page at the top of the page you will see link like https://test123.app.goo.gl/ where the bold section is your app_code

like image 150
Muhammad Younas Avatar answered Nov 10 '22 01:11

Muhammad Younas