我在FB文档上找不到任何关于此的内容,但基本上我正在寻找的是能够为FBWebDialogs添加多个FacebookId到Params中。这是我尝试的例子,但当然不对:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
facebookID1, @"to",
facebookID2, @"to",
facebookID3, @"to",
nil];
FBFrictionlessRecipientCache *friendCache = [[FBFrictionlessRecipientCache alloc] init];
[friendCache prefetchAndCacheForSession:nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"هل سمعت باليومي؟ برنامج iPhone إخباري روعا"]
title:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Case A: Error launching the dialog or sending request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// Case B: User clicked the "x" icon
NSLog(@"User canceled request.");
} else {
NSLog(@"Request Sent. %@", error);
}
}}
friendCache:friendCache];
答案 0 :(得分:1)
简单,将所有这些字符串放在一个数组中,然后params中的对象是字符串数组,键是@“to”。
答案 1 :(得分:1)
对于FBWebDialogs参数中的多个ID,您应将键设置为“至[0]”,“至[1]”,......“至[n]”:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
facebookID1, @"to[0]",
facebookID2, @"to[1]",
facebookID3, @"to[2]",
nil];