1

在我的应用程序中,我想用来向多个用户FBWebDialog发送“应用程序请求” 。但我不想从FBWebDialog. 我只想将朋友从那里传递FBfriendpicker viewcontrollerFBWebDialog那里并从那里发送。可能吗?我怎样才能做到这一点?谢谢。

4

2 回答 2

2

您需要按照下面引用的两个页面中的说明设置“to”参数,它将禁用下拉好友列表并仅发送给一个目标受众

https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/

发送有针对性的请求

您可以向下过滤建议列表或定位一个用户。要过滤列表,您可以传入一个参数,即包含逗号分隔的朋友列表的建议,以显示在选择中。要定位一个收件人,请将该用户的 ID 传递到 to 参数中

并且还记录在请求对话框页面上

to 用户 ID 或用户名,或以逗号分隔的列表。这些可能是也可能不是发件人的朋友。如果这是由应用程序指定的,则发件人将无法选择收件人。如果没有,发件人将看到一个多朋友选择器,并且最多可以选择 50 个收件人。(由于 URL 长度限制,在使用非 iframe 对话框时,IE7/IE8 中的最大收件人数为 25。)

facebook游戏部分的另一个文档,带有图片 https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/

NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:
    // 2. Optionally provide a 'to' param to direct the request at
    @"286400088", @"to", // Ali
    nil];
于 2013-08-03T19:46:01.047 回答
0

从 3.2 升级到 3.5.1 部分是为了让我使用无摩擦的好友请求。该过程适用于:

NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:nil];

FBFrictionlessRecipientCache *friendCache = [[FBFrictionlessRecipientCache alloc] init];
[friendCache prefetchAndCacheForSession:nil];

[FBWebDialogs presentRequestsDialogModallyWithSession:[FBSession activeSession]
                                                  message:[NSString stringWithFormat:@"I just posted an action - give me some points!"]
                                                    title:@"Get Points from your 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.");
                                                          }
                                                      }}
friendCache:friendCache];

这可以帮助您升级 Facebook sdk https://developers.facebook.com/docs/tutorial/iossdk/upgrading-from-3.2-to-3.5/

于 2013-05-29T13:16:31.897 回答