![](/img/trans.png)
[英]post on friends wall in Facebook using FBWebDialogs in ios
[英]iOS: Post on wall of Selected FB Friends using FBWebDialogs
我可以使用FBWebDialogs.image將圖片發布到Facebook朋友的牆上。我正在尋找如何將圖片發布到多個朋友的網站。
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Sharing Tutorial", @"name",
@"Build great social apps and get more installs.", @"caption",
@"Allow your users to share stories on Facebook from your app using the iOS SDK.", @"description",
@"https://developers.facebook.com/docs/ios/share/", @"link",
@"http://i.imgur.com/g3Qc1HN.png", @"picture",
@"100006771363037",@"to",
nil];
// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(@"Error publishing story: %@", error.description);
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User canceled.
NSLog(@"User cancelled.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"post_id"]) {
// User canceled.
NSLog(@"User cancelled.");
} else {
// User clicked the Share button
NSLog(@"fb web dialog result=====>%@",result);
NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
NSLog(@"result %@", result);
}
}
}
}];
在@“至”字段中添加朋友profile_id時,用逗號分隔時出現錯誤。在下面添加了屏幕截圖
您不能在Feed對話框的to
參數中添加多個ID。 實際上,無法一次將提要發布給多個朋友。 您必須分別為每個朋友調用對話框。
根據文檔 , to
是:
此故事將發布到的配置文件的ID或用戶名。 如果未指定,則默認為from的值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.