从 Facebook iOS SDK 版本 3.7.1 升级到 3.8 后,当通过 Facebook 使用我的应用进行身份验证时,我开始在控制台日志中看到以下内容:
FBSDKLog: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xc5a9cf0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 100;
message = "(#100) The parameter 'custom_events' or 'custom_events_file' is required for the 'CUSTOM_APP_EVENTS' activity";
type = OAuthException;
};
};
code = 400;
headers = (
{
name = "Access-Control-Allow-Origin";
value = "*";
},
{
name = "Cache-Control";
value = "no-store";
},
{
name = Connection;
value = close;
},
{
name = "Content-Type";
value = "text/javascript; charset=UTF-8";
},
{
name = Expires;
value = "Sat, 01 Jan 2000 00:00:00 GMT";
},
{
name = Pragma;
value = "no-cache";
},
{
name = "WWW-Authenticate";
value = "OAuth \"Facebook Platform\" \"invalid_request\" \"(#100) The parameter 'custom_events' or 'custom_events_file' is required for the 'CUSTOM_APP_EVENTS' activity\"";
},
{
name = "x-fb-loadmon";
value = "0,2.76,90";
}
);
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x12e5e9c0, state: FBSessionStateOpen, loginHandler: 0x12e58630, appID:..., urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0xd884b00>, expirationDate:..., refreshDate:..., attemptedRefreshDate:..., permissions:...>}
我已经下载了示例 Facebook iOS 应用程序的最新版本,并验证了我在 AppDelegate 中对 Facebook SDK 的调用是最新的。为了进行身份验证,我将 openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:
消息发送到 FBSession
。
这似乎很可能是 Facebook 的错误(我将向他们提交错误),但也有可能是我做错了什么——任何帮助/见解将不胜感激!
我通过在我的 AppDelegate 中添加对 [FBAppEvents setFlushBehavior:FBAppEventsFlushBehaviorExplicitOnly];
的调用暂时解决了这个问题,但我更喜欢更全面的解决方案。
2014 年 3 月 24 日编辑
这不再能在 3.8 上重现(也不会在 3.13 上重现,我也测试过)。看来 Facebook 一定已经在服务器上修复了这个问题。
最佳答案
- 前往 developers.facebook.com
- 在标题栏中,点击“应用程序”
- 选择您当前正在使用的应用,然后点击“编辑应用”
- 在左侧导航栏上,您会看到“设置”标签
- 在“设置”下,点击“高级”选项卡并向下滚动到“见解”部分
- 将“Install Insights”和“Mobile SDK Insights”更改为“Disabled”
关于ios - 'custom_events' 事件需要参数 'custom_events_file' 或 'CUSTOM_APP_EVENTS',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19126703/