6

I am trying to implement an App Invite system in my Android app with Firebase. The code is exactly as that given in their guide.

private void onInviteClicked() {
    Intent intent = new AppInviteInvitation.IntentBuilder("Title here")
            .setMessage("message here")
            .setDeepLink(Uri.parse("deep_link_here")
            .setCallToActionText("Install!"))
            .build();
    startActivityForResult(intent, REQUEST_INVITE);
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);

    if (requestCode == REQUEST_INVITE) {
        if (resultCode == RESULT_OK) {
            // Get the invitation IDs of all sent messages
            String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
            for (String id : ids) {
                Log.d(TAG, "onActivityResult: sent invitation " + id);
            }
        } else {
            // Sending failed or it was canceled, show failure message to the user
            // ...
            Toast.makeText(getContext(), "Invite not sent!", Toast.LENGTH_SHORT).show();
        }
    }
}

My problem is:

  • I can select emails amongst my contacts and it sends email invitations to them. However, it still returns resultCode 0 and ids is null.
  • When I select a phone number from the list of contacts displayed, the fragment/activity force closes and again resultCode is 0.
Sumod Kulkarni
  • 290
  • 3
  • 4
  • 9

1 Answers1

0

This looks like a bug confirmed by Firebase member.

https://github.com/firebase/quickstart-android/issues/750

Update: This has been fixed in 16.1.0 update.

Vairavan
  • 1,246
  • 1
  • 15
  • 19