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