gpt4 book ai didi

ios - 如何在 objective-c 中在 friend 的墙上共享多个帖子

转载 作者:行者123 更新时间:2023-12-01 19:10:33 25 4
gpt4 key购买 nike

我正在使用Facebook SDK张贴在 friend 的墙上。我能够发布它,但是当我在FBWebDialog中选择多个 friend 而不是同时为每个 friend 发布两个 friend 时,将显示一个单独的对话框。如何在多个 friend 的墙上张贴。

-(void)showFriendsList
{
friendPickerController = [[FBFriendPickerViewController alloc] init];
friendPickerController.title = @"Pick Friends";
friendPickerController.delegate = self;
[friendPickerController loadData];
}

-(IBAction)facebookShare:(UIButton *)sender
{
[friendPickerController presentModallyFromViewController:self animated:YES handler:
^(FBViewController *sender, BOOL donePressed) {

if (!donePressed)
{
return;
}

NSString* fid;
NSString* fbUserName;

for (id<FBGraphUser> user in friendPickerController.selection)
{
NSLog(@"\nuser=%@\n", user);
fid = user.id;

fbUserName = user.name;

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:remedyLabel, @"caption", appIcon, @"picture",symptomName, @"name",remedyDescription,@"description",fid,@"tags",fid,@"to",@"106377336067638",@"place", nil];

NSLog(@"\nparams=%@\n", params);

[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/feed",fid] parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection,id result,NSError *error)
{
[FBWebDialogs presentFeedDialogModallyWithSession:nil parameters:params handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error)

{
if (error)
{

NSLog(@"Error publishing story.");
}
else
{
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(@"User canceled story publishing.");
}
else
{

// Handle the publish feed callback

//Tell the user that it worked.
NSLog(@"Request Sent");
}

}
}];
}];

}

}];
}

最佳答案

不,那不可能。您必须为每个 friend 打开单独的对话框。

关于ios - 如何在 objective-c 中在 friend 的墙上共享多个帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16834007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com