问题
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 
resultCode0 andidsis null. - When I select a phone number from the list of contacts displayed, the fragment/activity force closes and again 
resultCodeis 0. 
回答1:
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.
来源:https://stackoverflow.com/questions/40921875/firebase-invites-sends-emails-but-not-sms-returns-resultcode-0