1

Recently I integrated authorization via facebook in my application.

My code for authorization:

AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];

if (!mainDelegate.session || mainDelegate.session.state != FBSessionStateCreated)
{
    mainDelegate.session = [[FBSession alloc] initWithPermissions:[NSArray arrayWithObjects:@"email", @"offline_access", @"user_birthday", @"user_photos", @"publish_actions", @"publish_stream", @"read_stream", nil]];

}

[mainDelegate.session openWithCompletionHandler:^(FBSession *session,
                                                  FBSessionState status,
                                                  NSError *error)
{
    FBSession.activeSession = session;
    if(mainDelegate.session.isOpen)
    {
        //getting access token
    }
}];

But after that I receiving:

    FBSDKLog: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x17e5aa80 {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,49.16,50";
            }
        );
    }, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x17eac610, state: FBSessionStateOpen, loginHandler: 0x17eeb1d0, appID: 123456789012345, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x17ecef60>, expirationDate: 2014-01-07 10:09:59 +0000, refreshDate: 2013-11-08 10:28:09 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
        email,
        "offline_access",
        "user_birthday",
        "user_photos",
        "publish_actions",
        "publish_stream",
        "read_stream"
    )>}

I disabled "Install Insights" and "Mobile SDK Insights" as was offered here: The parameter 'custom_events' or 'custom_events_file' is required for the 'CUSTOM_APP_EVENTS' activity but I still see this error I disabled insights a week ago, so server already updated settings.

But despite this error, authorization working fine, I'm getting access token and all needed data successfully. But I'm worrying about this, if this error can provide problems in future. How can I avoid this? Why this error appears?

Community
  • 1
  • 1
unkm
  • 43
  • 3

0 Answers0