我正在使用Facebook SDK在我的应用程序中连接Facebook。用户可以发送邀请给他们的朋友。 (使用FB SDK提供的请求对话框)。Facebook iOS应用程序邀请好友
https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/
而且我试图保持好友列表清楚,如果朋友是否已经收到邀请(曾经的朋友被接受与否),从列表中隐藏的朋友。但我找不到这样做的方式。有没有办法做到这一点?
我正在使用Facebook SDK在我的应用程序中连接Facebook。用户可以发送邀请给他们的朋友。 (使用FB SDK提供的请求对话框)。Facebook iOS应用程序邀请好友
https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/
而且我试图保持好友列表清楚,如果朋友是否已经收到邀请(曾经的朋友被接受与否),从列表中隐藏的朋友。但我找不到这样做的方式。有没有办法做到这一点?
我不认为你可以排除有请求发送给他们的朋友,但你可以建议朋友填写该列表。也许如果您已经知道您向谁发送了请求,您可以将其与其他朋友一起填充到列表中。
Facebook的文档是可怕的,但我发现它是可以排除认证朋友如下:
// See https://developers.facebook.com/docs/games/requests/v2.1 for explanation of the possible parameter keys
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
// Optional parameter for sending request directly to user
// with UID. If not specified, the MFS will be invoked
// @"RECIPIENT_USER_ID", @"to",
// Give the action object request information
// @"send", @"action_type",
// @"YOUR_OBJECT_ID", @"object_id",
@"app_non_users", @"filters",
nil];
[FBWebDialogs
presentRequestsDialogModallyWithSession:nil
message:@"Join me!"
title:@"Invite Friends"
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.");
}
}
}];
@“app_non_users”,@“过滤器”,是最重要的部分!