Firebase Invites sends Emails but not SMS. Returns resultCode 0

為{幸葍}努か 提交于 2019-12-07 03:23:55

问题


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.

回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!