Search code examples
iphoneiosfacebookcocos2d-iphone

Facebook posting error in ios


Here i am trying to add a post to facebook using following code.

FBAppCall *appCall = [FBDialogs presentShareDialogWithLink:urlToShare
                                                          name:@"Title"
                                                       caption:nil
                                                   description:@"description"
                                                       picture:nil
                                                   clientState:nil
                                                       handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                                           if (error) {
                                                               NSLog(@"Error: %@", error.description);
                                                           } else {
                                                               NSLog(@"Success!");
                                                           }
                                                       }];

But this isn't working. It give following error.

Error Domain=com.facebook.Facebook.platform Code=102 "The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)" UserInfo=0x1cde3340 {error_code=102, action_id=E780C3AA-1387-4B9C-9A3A-9A16FB54BC59, error_message=An error occurred during publishing., app_id=558567750859724}

Here i am working on cocos2d, is this can be the reason.


Solution

  • Go to your app's settings under the Facebook developer portal.

    Go to open graph > types

    Choose the action type using and turn on "User Generated Images" for that action type. Save these settings and try again. It will work.