2014-06-21 158 views
0

我使用Facebook sdk 3.10一次使用FBWebDialogs向多个朋友发送请求。以下代码正在使用,所有事情都很好,例如选择多个朋友,向他们发送请求。但是有一个问题,这个FBWebDialogs是否使用了一些朋友的限制,因为我有更多的300个朋友,但是这总是只显示12-15个朋友。使用FBWebDialogs通过iPhone应用程序邀请Facebook好友

CODE

[FBWebDialogs 
      presentRequestsDialogModallyWithSession:nil 
      message:@"Learn how to make your iOS apps social." 
      title:nil 
      parameters:nil 
      handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) { 
       if (error) { 
        // Error launching the dialog or sending the request. 
        NSLog(@"Error sending request."); 
       } else { 
        if (result == FBWebDialogResultDialogNotCompleted) { 
         // User clicked the "x" icon 
         NSLog(@"User canceled request."); 
        } else { 
         // Handle the send request callback 
         NSDictionary *urlParams = [self parseURLParams:[resultURL query]]; 
         if (![urlParams valueForKey:@"request"]) { 
          // User clicked the Cancel button 
          NSLog(@"User canceled request."); 
         } else { 
          // User clicked the Send button 
          NSString *requestID = [urlParams valueForKey:@"request"]; 
          NSLog(@"Request ID: %@", requestID); 
         } 
        } 
       } 
      }]; 

使用上面我只能看到在对话框中最多12个朋友吗?我错过了什么吗?

任何帮助,将不胜感激。

+0

你有没有发现任何解决方案?我面临同样的问题,它适用于20-30个朋友,但在此之上它会自动用FBWebDialogResultDialogNotCompleted结果自动锁定对话框! –

回答

0

您应该将NSDictionary类型对象传递给parameters参数。 您可以创建这样的:

NSArray *suggestedFriends = [[NSArray alloc] initWithObjects:@"fb_id1", @"fb_id2", nil]; 

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:[suggestedFriends componentsJoinedByString:@","], @"suggestions", nil]; 

现在

[FBWebDialogs 
      presentRequestsDialogModallyWithSession:nil 
      message:@"Learn how to make your iOS apps social." 
      title:nil 
      parameters:params 
      handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) { 
       if (error) { 
        // Error launching the dialog or sending the request. 
        NSLog(@"Error sending request."); 
       } else { 
        if (result == FBWebDialogResultDialogNotCompleted) { 
         // User clicked the "x" icon 
         NSLog(@"User canceled request."); 
        } else { 
         // Handle the send request callback 
         NSDictionary *urlParams = [self parseURLParams:[resultURL query]]; 
         if (![urlParams valueForKey:@"request"]) { 
          // User clicked the Cancel button 
          NSLog(@"User canceled request."); 
         } else { 
          // User clicked the Send button 
          NSString *requestID = [urlParams valueForKey:@"request"]; 
          NSLog(@"Request ID: %@", requestID); 
         } 
        } 
       } 
      }]; 

这将显示所有与Facebook的建议IDS的朋友。

相关问题