0

I am working with the sample code here to integrate Firebase Invites into my app: https://github.com/firebase/quickstart-android/tree/master/invites

The sample works as expected, when I click on the Invite button, I receive a screen where I can select the recipient of my invite. See image.

enter image description here

However, when I add the exact same code to my app, after clicking the invite button, I receive a native Android chooser which let's me decide what app should perform this action. See image.

enter image description here

If I dismiss this chooser, I am then taken to the expected Invite screen where I can choose the recipient.

What I am wondering, how do I get rid off that default app chooser. There must be something in my app (even though I think the code is the same as the sample) which causes the chooser to appear.

any ideas? thanks

EDIT:

public void onInviteClicked() {
    Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invite_title))
            .setMessage(getString(R.string.invite_message))
            .setDeepLink(Uri.parse(getString(R.string.invite_deep_link)))
            .setCustomImage(Uri.parse(getString(R.string.invite_custom_image)))
            .setCallToActionText(getString(R.string.invite_cta))
            //.setEmailSubject("subject of email")
            .build();
    startActivityForResult(intent, REQUEST_INVITE);
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Kenneth Browning
  • 1,360
  • 1
  • 13
  • 22
  • 1
    Please post the code for the `Intent` that you use to start the Invite screen. By default, if there is more than one app subscribed to the particular Intent filter than the Android OS pops up action chooser. – nstosic Sep 22 '16 at 11:44
  • @NitroNbg - thanks for the quick response. I added the Intent to the description – Kenneth Browning Sep 22 '16 at 11:53
  • 1
    Your `IntentBuilder` code looks fine. Is there any other listener or callback that's fired when you click the share button? – nstosic Sep 22 '16 at 11:59
  • Bingo: your first comment got me thinking exactly along the same lines as your second comment now pointed out:) and found the culprit. I had another intent executed at the same time which was doing Uri.parse. thank you very much. – Kenneth Browning Sep 22 '16 at 12:05
  • Good job. You're the one that fixed it, not me :D – nstosic Sep 22 '16 at 13:46

0 Answers0