Firebase dynamischer Link öffnet die App nicht

Ich habe lokal auf meinem Gerät eine Android-App entwickelt (App noch nicht im Android Play Store). Ich habe die folgende Logik, um einen Deep Link in MainActivity zu erhalten.

GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, null)
            .addApi(AppInvite.API)
            .build();

    // Check if this app was launched from a deep link. Setting autoLaunchDeepLink to true
    // would automatically launch the deep link if one is found.
    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);

                                Toast.makeText(getApplicationContext(), deepLink, Toast.LENGTH_LONG).show();
                                // Handle the deep link. For example, open the linked
                                // content, or apply promotional credit to the user's
                                // account.

                                // ...
                            } else {
                                Log.d(TAG, "getInvitation: no deep link found.");
                            }
                        }
                    });

Ich habe einige dynamische Links mit der Firebase-Konsole erstellt und im mobilen Browser geöffnet. Aber es öffnet meine App nicht und erreicht die Zeile String deepLink = AppInviteReferral.getDeepLink (intent);

Stattdessen wird die URL im mobilen Browser selbst geöffnet.

Wie öffne ich die App und wie gehe ich mit Deep Link in der Aktivität um, während ich Firebase Dynamic Link verwende?

Bearbeiten

Ich habe Absichtsfilter in der Manifestdatei.

<activity android:name="MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:host="example.com" android:scheme="http"/>
            <data android:host="example.com" android:scheme="https"/>
        </intent-filter>
    </activity>

Antworten auf die Frage(10)

Ihre Antwort auf die Frage