创建Firebase邀请意图时,我尝试按照documentation中的说明添加指向iOS应用的链接:
intent = new AppInviteInvitation.IntentBuilder(context.getString(R.string.invitation_title))
.setMessage(context.getString(R.string.invitation_message))
.setOtherPlatformsTargetApplication(
AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS,
"1059710961")
.build();
“1059710961”和“mobi.appintheair.wifi”都会导致同样的错误:
AppInviteAgent: Create invitations failed due to error code: 3
AppInviteAgent: Target client ID must include non-empty and valid client ID: 1059710961. (APPINVITE_CLIENT_ID_ERROR)
此参数的正确格式是什么?
答案 0 :(得分:4)
要获取此客户端ID,您必须执行以下操作:
GoogleServices-Info.plist
google-services.json
CLIENT_ID
的值(将会是这样的123456789012-abababababababababababababababab.apps.googleusercontent.com
)将其添加到构建器:
intent = new AppInviteInvitation.IntentBuilder(context.getString(R.string.invitation_title))
............
.setOtherPlatformsTargetApplication(
AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS,
"123456789012-abababababababababababababababab.apps.googleusercontent.com")
.build();
答案 1 :(得分:2)
client_id是您从iOS应用程序的firebase控制台下载的plist中的一个