8

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:

4
  • 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? Commented Jun 8, 2016 at 5:51
  • I edit my question. Commented Jun 8, 2016 at 7: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: <data android:scheme="aqld" android:host="test" android:pathPattern=".*" /> they should be fine. If the intent filter differs seriously, that is likely a problem. Commented Jun 8, 2016 at 8:13
  • I've tried without success. I've changed my question with more infos. Commented Jun 8, 2016 at 11:08

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

1 Comment

could you please show the initialization of mGoogleApiClient. Have you added AppInvite.API?
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/

2 Comments

I've tried, doesn't works. I'm trying with an app that isn't on Play Store, this could be the problem?
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.
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. :)

1 Comment

Hi, thanks for your answer. I've verified and the SHA1 are added correctly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.