[英]not able to post link and images to friends wall with facebook new sdk 3.11
我正在使用facebook new sdk 3.11通過fbwebdialog將鏈接和圖像發布到朋友牆。給定鏈接參數時出現以下錯誤(如下圖所示)
我正在使用Xcode 5,我的代碼如下
NSMutableDictionary *params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"TESTING PURPOSE", @"name",@"545268428900714",@"app_id",fid,@"to",@"http://www.google.com",@"link", nil];
[FBWebDialogs presentFeedDialogModallyWithSession:nil parameters:params1 handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
{
NSLog(@"result ======%@",resultURL);
if (error)
{
NSLog(@"error ======%@",error);
}
else
{
if (result == FBWebDialogResultDialogNotCompleted)
{
NSLog(@"User canceled story publishing.");
}
else
{
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"post_id"])
{
NSLog(@"User canceled story publishing.");
}
else
{
// [FBSession.activeSession close];
//[FBSession.activeSession closeAndClearTokenInformation];
double delayInSeconds = 0.5;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Thank You!" message:[NSString stringWithFormat:@"Your Post has been Posted to your friends wall!"] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
});
}
}
}
}];
發生此錯誤的原因是所選的應用程序將是“圖形資源管理器”,並且其畫布/網站網址未指向您的網站。
通過用戶Samuel Wood(Otto)從WordPress論壇獲得的答案:
Go to the Facebook App. Edit its settings. On the Advanced settings page, disable the "Stream post URL security" option.
請參閱此 SO問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.