7

I'm using dynamic links for my app.

I've followed the tutorial step-by-step and I'm able to open the app by clicking on the link posted on facebook.

But when I invoke getInvitation, I always have CANCELED as status of AppInviteInvitationResult.

    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).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);

                        // [END_EXCLUDE]
                    } else {
                        Log.d("StartActivity", "getInvitation: no deep link found.");
                    }
                }
            });

Into debug, I can see that result.getStatus() returns CANCELED, but the click on lick open the app correctly.

Where I'm wrong?

EDIT: The link that I'm using is: https://wft4z.app.goo.gl/?link=https://aqld.it/testlink/112972&al=aqld://test/about?params%3D17363&apn=com.project.mydeeplink

The filter on manifest:

CeccoCQ
  • 3,746
  • 12
  • 50
  • 81
  • How does your url look like (opened, full size url)? If you added that to your question I would be easier to analyze what could be wrong. Also, when/where do you invoke get invitation? – diidu Jun 08 '16 at 05:51
  • I edit my question. – CeccoCQ Jun 08 '16 at 07:30
  • apn is twice in your url, I wonder if that has any effect? I should have asked for intent-filter also, but if your app package is com.project.deeplink and the data in your intent filter in the manifest looks something like this: they should be fine. If the intent filter differs seriously, that is likely a problem. – diidu Jun 08 '16 at 08:13
  • I've tried without success. I've changed my question with more infos. – CeccoCQ Jun 08 '16 at 11:08

3 Answers3

0

The status is canceled when no intent has been received. I was wondering the same thing and it turned out that my links created in firebase web page were wrong. I wrote some ideas on how to debug the url problem as an answer to another question. If you have the same problem as I did, they should be helpful:

https://stackoverflow.com/a/37615175/4025606

Community
  • 1
  • 1
diidu
  • 2,823
  • 17
  • 32
0

Doesn't directly answer your question but you could eliminate badly formed urls as a root cause by using this page to create firebase dynamic links for both ios and Android: http://fdl-links.appspot.com/

Arun Venkatesan
  • 403
  • 3
  • 7
  • I've tried, doesn't works. I'm trying with an app that isn't on Play Store, this could be the problem? – CeccoCQ Jun 07 '16 at 17:56
  • I have the same issue. The app starts after opening the link but the callback gets always canceled. However my app is on the playstore. – shalama Jun 11 '16 at 08:32
0

Just double-check if you have added the SHA-1 in the firebase console and the added SHA-1 matches the SHA1 of the generated APK. I was seeing the same issue - result.getStatus() returning CANCELED prior to this, but after adding the SHA-1 on firebase console, it started working fine. :)

user2725461
  • 51
  • 1
  • 3