0

I have a huge problem implementing the Firebase dynamic links in android.

I followed exactly this instruction: https://firebase.google.com/docs/dynamic-links/android

My Manifest is correct, my firebase project includes correct sha1 keys.

If i trigger via ADB my target intent is opening BUT the AppInviteInvitationResult has always the status CANCELED.

I tried everything and couldnt find any solution...

My code is looking like this:

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

    boolean autoLaunchDeepLink = false;
    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink).setResultCallback(
            new ResultCallback<AppInviteInvitationResult>() {
                @Override
                public void onResult(@NonNull AppInviteInvitationResult result) {
                    if (result.getStatus().isSuccess()) {
                        Intent intent = result.getInvitationIntent();
                        String deepLink = AppInviteReferral.getDeepLink(intent);
                        // MY CODE
                    }
                }
            });

onResult is called but status is always CANCELED !

Manifest looking like this:

 <activity
        android:name="appsoluts.kuendigung.ActivityDeepLink"
        android:theme="@style/AppTheme.NoActionBar"
        android:screenOrientation="portrait"
        android:parentActivityName="appsoluts.kuendigung.ActivityMain"
        android:launchMode="singleTop"
        android:configChanges="orientation|screenSize"
        android:windowSoftInputMode="stateHidden|adjustResize">

        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:host="kuendigung.org" android:scheme="http"/>
            <data android:host="kuendigung.org" android:scheme="https"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:host="bien-resilier.fr" android:scheme="http"/>
            <data android:host="bien-resilier.fr" android:scheme="https"/>
        </intent-filter>

        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="appsoluts.kuendigung.ActivityMain" />

    </activity>

Any ideas ?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Chrissss
  • 97
  • 8

1 Answers1

0

You should also add SHA256 of your key to your android app configuration in firebase panel.

Sajad Norouzi
  • 1,790
  • 2
  • 17
  • 26