我正在开发一个使用Facebook SDK 3.23.2的现有项目。我正在尝试使用FBDialogs
presentShareDialogWithParams
方法在FB墙上共享数据。共享对话框正在打开,但发布数据错误状态即将到来&我无法在墙上张贴..
以下是我的代码:
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
}
}
}];
该方法始终以if(error)
循环和&显示状态为错误。当我尝试通过创建一个简单的新项目来使用它时,同样的方法是有效的,但它在我的应用程序中不起作用...
提前致谢
答案 0 :(得分:0)
只需在.plist file
中删除我的脸书显示名称。