繁体   English   中英

Facebook iOS应用邀请朋友

[英]Facebook iOS App Invite Friends

我正在使用Facebook SDK在我的应用程序中连接Facebook。 用户可以向他们的朋友发送邀请。 (使用FB SDK提供的“请求”对话框)。

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”,@“过滤器”是重要的部分!

我认为您不能排除已将请求发送给他们的朋友,但是您可以建议朋友填充该列表。 也许,如果您已经知道向谁发送了请求,则可以用其余的朋友来填充列表。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM