【问题标题】:Facebook iOS App Invite FriendsFacebook iOS 应用程序邀请朋友
【发布时间】:2013-02-26 03:24:00
【问题描述】:

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

https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/

如果朋友已经被邀请(无论朋友是否被接受),我会尽量保持朋友列表清晰,从列表中隐藏朋友。但我找不到这样做的方法。有没有办法做到这一点?

【问题讨论】:

    标签: ios facebook request invite


    【解决方案1】:

    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",@"filters",是重要的部分!

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2015-07-29
        • 1970-01-01
        • 1970-01-01
        • 2012-12-02
        • 2014-06-26
        • 1970-01-01
        • 1970-01-01
        • 2011-06-09
        • 2011-06-01
        相关资源
        最近更新 更多