iOS FBDialog crashes after clicking on Post

172 views Asked by At

I am trying to create a share dialog to post on Facebook the user action. To do that I use this code:

id<FBGraphObject> fbObject =
[FBGraphObject openGraphObjectForPostWithType:@"namespace:action"
                                        title:@"Titolo"
                                        image:imageURL
                                          url:URL
                                  description:@"descrizione"];

id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:fbObject forKey:@"samplename"];

[FBDialogs presentShareDialogWithOpenGraphAction:action
                                      actionType:@"namespace:action"
                             previewPropertyName:@"samplename"
                                         handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                             if(error) {
                                                 NSLog(@"Error: %@", error.description);
                                             } else {
                                                 NSLog(@"Success");
                                             }
                                         }];

The fbdialog is correctly displayed, but when I click on "Post" to complete the posting, the progress bar on facebook stops and I am redirected again to my app, so it fails the posting.

Everything works fine by posting with the Graph API Explorer but I am not able to do that from the app.

0

There are 0 answers