简体   繁体   中英

Not able to post on wall using [FBDialogs presentShareDialogWithParams] method

I am working on an existing project in which Facebook SDK 3.23.2 is used. I am trying to share data on FB wall by using the FBDialogs presentShareDialogWithParams method. Share dialog is opening but while posting data error status is coming & I am not able to post on wall..

Following is my code:

FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:@"https://developers.facebook.com/ios"];
params.picture = [NSURL
                  URLWithString:@"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"];
params.name = @"Facebook SDK for iOS";
params.caption = @"Build great social apps and get more installs.";

if ([FBDialogs canPresentShareDialogWithParams:params])
{

    NSLog(@"in app");

    FBAppCall *call=  [FBDialogs presentShareDialogWithParams:params clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                           if(error) {
                               [ALToastView toastInView:self.view withText:@"error "];
                               // If there's an error show the relevant message

                           } else {
                               // Check if cancel info is returned and log the event
                               if (results[@"completionGesture"] &&
                                   [results[@"completionGesture"] isEqualToString:@"cancel"]) {


                                   [ALToastView toastInView:self.view withText:@"Inviting Via Facebook Cancelled"];
                                   NSLog(@"User canceled story publishing.");
                               } else {

                                   [ALToastView toastInView:self.view withText:@"Inviting Via Facebook success"];
                                   // If the post went through show a success message
                               }
                           }
                       }];

The method is always going to if(error) loop & showing status as error. While the same method is working when I am trying to use it by creating a simple new project but it is not working in my app... Thanks in advance

只需删除.plist file我的Facebook显示名称即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM