我集成了 Facebook Unity SDK、登录并能够通过 FB.AppRequest() 发送请求。当我这样做时,朋友选择器对话框按预期弹出,我可以很好地解析回调函数中邀请谁的结果。
我已经在这里阅读了文档: https ://developers.facebook.com/docs/unity/reference/current/FB.Apprequest/
SDK 和此处的示例代码: https ://github.com/fbsamples/friendsmash-unity
但是在弹出对话框时我似乎无法让 excludeIds 字段工作。
这是我使用的代码:
string excludeID1 = "123456789"; // Obviously I'm using real FB friend ids (non-dev accounts)
string excludeID2 = "987654321";
string[] excludeIDs = { excludeID1, excludeID2 };
FB.AppRequest(
message: "This game is amazing! Check it out.",
title: "Play this game with me!",
excludeIds: excludeIDs,
callback: AppRequestCallback
);
void AppRequestCallback( FBResult response )
{
// Everything fine here, can parse selected/invited friend IDs, no errors reported
}
这些“排除”的朋友仍然出现在对话框中。有什么建议我哪里出错了吗?