我想使用FBWebDialog向朋友发送请求。是否可以使用预定义的接收器部分打开FBWebDialog。我的意思是,例如,我将向FB ID为00000和11111的朋友发送请求。是否可以在接收器部分打开已经有00000和11111的FBWebDialog?我也不想要FBWebDialog附带的朋友列表。
所以我只想有可能向预定义的接收器发送请求。
如果除了FBWebDialog之外还有其他功能,那也没关系。
提前致谢。
答案 0 :(得分:0)
通过将'to'参数指定为逗号分隔列表,可以使用标准FBWebDialog类完成此操作。
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
// 2. Optionally provide a 'to' param to direct the request at
@"000000,111111", @"to",
nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", nScore]
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.");
}
}}];