Firebase应用邀请 - 邀请未发送

6

我在我的应用程序中实现了Firebase App邀请,我可以选择要邀请的朋友,但邀请未发送。

在onActivityResult中,resultCode为3。

在我的Firebase项目设置中,我已经输入了SHA1代码(发布和调试证书)。

我的Activity代码:

public static final int REQUEST_INVITE = 65;
private static final String TAG = GeneralActivity.class.getSimpleName();

public void inviteFriends() {
    Intent intent = new AppInviteInvitation.IntentBuilder("Invitation title")
            .setMessage("Invitation message")
            .setOtherPlatformsTargetApplication(AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS, MY_IOS_APPID)
            .build();
    startActivityForResult(intent, REQUEST_INVITE);
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQUEST_INVITE) {
        if (resultCode == RESULT_OK) {
            String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
            for (String id : ids) {
                Log.d(TAG, "onActivityResult: sent invitation " + id);
            }
        } else {
            Log.d(TAG, "Invitation not sent");
        }
    }
}

Gradle项目:

dependencies {
         classpath 'com.android.tools.build:gradle:2.2.0'
         classpath 'com.google.gms:google-services:3.0.0'
     }

Gradle模块:

dependencies {
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.google.android.gms:play-services-ads:9.6.1'
    compile 'com.google.firebase:firebase-core:9.6.1'
    compile 'com.google.firebase:firebase-ads:9.6.1'
    compile 'com.google.firebase:firebase-crash:9.6.1'
    compile 'com.google.firebase:firebase-invites:9.6.1'
}

apply plugin: 'com.google.gms.google-services'

为什么邀请功能无法使用?我该如何解决这个问题?
1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接