使用FBWebDialogs通过iPhone应用邀请Facebook好友
我正在使用Facebook sdk 3.10,通过使用FBWebDialogs通过iPhone应用邀请Facebook好友,iphone,facebook,facebook-graph-api,ios7,Iphone,Facebook,Facebook Graph Api,Ios7,我正在使用Facebook sdk 3.10,通过FBWebDialogs一次向多个朋友发送请求。下面是我正在使用的代码,所有的事情都很好,比如选择多个朋友,向他们发送请求。但有一个问题,这FBWebDialogs使用了一些限制的朋友,因为我有300多个朋友,但这总是只显示12-15个朋友 代码 [FBWebDialogs presentRequestsDialogModallyWithSession:nil message:@"Learn h
FBWebDialogs
一次向多个朋友发送请求。下面是我正在使用的代码,所有的事情都很好,比如选择多个朋友,向他们发送请求。但有一个问题,这FBWebDialogs使用了一些限制的朋友,因为我有300多个朋友,但这总是只显示12-15个朋友
代码
[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个朋友?我错过什么了吗
任何帮助都将不胜感激。您应该将
NSDictionary
type对象传递给parameters参数。
您可以这样创建:
NSArray *suggestedFriends = [[NSArray alloc] initWithObjects:@"fb_id1", @"fb_id2", nil];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:[suggestedFriends componentsJoinedByString:@","], @"suggestions", nil];
现在
在这里,它将显示所有具有建议的Facebook ID的朋友。您找到解决方案了吗?我面临着同样的问题,它可以很好地为20-30个朋友,但以上,它将自动关闭与FBWebDialogResultDialogNotCompleted结果对话框!
[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);
}
}
}
}];