我在 firebase 控制台中添加了 SHA1 调试和发布密钥,仍然没有运气为什么没有发送邀请?
我是 firebase 邀请的新手,并根据文档实施:
invitesButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Amplitude.getInstance().logEvent("INVITE EVENT");
Intent intent = new AppInviteInvitation.IntentBuilder("Invitation")
.setMessage("Help your friend unlock his favourite celebrity at FanStation : app link here")
.setCustomImage(Uri.parse("https://postimg.org/image/5sbdexljh/"))
.setCallToActionText("Unlock Celebrity Now")
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
});
// 无论成功还是失败,我的 Toast 文本都不会出现,因为我得到 65537 作为请求代码和 -1 作为结果代码
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d("Invites", "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);
Log.d("Invites","requestCode="+requestCode+"resultCode=" + resultCode);
if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
Amplitude.getInstance().logEvent("INVITE SUCCESS");
Log.d("Invites","Success");
Toast.makeText(getActivity(),"Invites Successful",Toast.LENGTH_LONG).show();
} else {
Amplitude.getInstance().logEvent("INVITE FAILURE");
Toast.makeText(getActivity(),"Please Try Again Later",Toast.LENGTH_LONG).show();
}
}
}