Search code examples
iosobjective-cfacebook-graph-apifacebook-ios-sdkfacebook-sharer

How to get post id after successful FB ShareDialog post


I am referring "ios 3.5 how to" by Facebook. Here is my code

[FBDialogs presentShareDialogWithParams:params
                        clientState:nil
                            handler:
 ^(FBAppCall *call, NSDictionary *results, NSError *error) {
 if(error) {
     // If there's an error show the relevant message
     [self showAlert:[self checkErrorMessage:error]];
 } else {
     // Check if cancel info is returned and log the event
     if (results[@"completionGesture"] &&
         [results[@"completionGesture"] isEqualToString:@"cancel"]) {
         NSLog(@"User canceled story publishing.");
     } else {
         // If the post went through show a success message
         [self showAlert:[self checkPostId:results]];
     }
 }

In results I only get didComplete key with value 1. How can I get post_id?


Solution

  • use dictionary

    call.dialogData.clientState