在 iOS 的本机邀请对话框中列出所有 Facebook 好友
List out all Facebook friends in native invite dialogbox in iOS
我正在尝试邀请 ios 中的 Facebook 好友。成功地我也得到了输出。我也附上了那个输出图像。
我的问题是,在这里我可以看到推荐的好友列表,而不是显示我的所有好友。但是当我在搜索栏中搜索任何朋友时,它会显示该搜索列表。我的代码是,
NSString *MY_URL = [NSString stringWithFormat:@"xxxxxxxxxx://host"];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:@"Hi, Check out this app, You'll love it!" forKey:@"message"];
[params setObject:MY_URL forKey:@"link"];
[FBWebDialogs presentRequestsDialogModallyWithSession:FBSession.activeSession
message:@"Friends Invite"
title:@"xxxxxxxx"
parameters:params handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
{
if (!error) {
NSLog(@"Url : %@",resultURL);
NSLog(@"Result : %u",result);
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);
}
}
else
{
NSLog(@"Error : %@",[error localizedDescription]);
}
}];
我的意思是如何在此邀请列表中显示我所有的朋友。
对于 2014 年 4 月之后注册的 Facebook 应用程序,您无法访问所有好友,除非您正在实施 game/canvas 应用程序。 (如果是这种情况,您将需要使用 invitable_friends 端点)
否则,很遗憾,您将只能访问已经登录到您应用的 Facebook 好友用户。
注意:即使您的应用是在 2014 年 4 月之前创建的,所有朋友在 2015 年 4 月之后都将无用。
For more info in facebook developer
New features available in v2.0
Taggable Friends API: We've added a new endpoint called /me/taggable_friends that you can use in order to generate stories that have friends tagged in them, even those friends don't use your app. If you want to use the taggable friends API, your app will require review.
Invitable Friends API: We've added a new endpoint called /me/invitable_friends that you can use to generate a list of friends for someone to invite to your game through a custom interface. This API is only available to apps that are games on Facebook Canvas.
我正在尝试邀请 ios 中的 Facebook 好友。成功地我也得到了输出。我也附上了那个输出图像。
我的问题是,在这里我可以看到推荐的好友列表,而不是显示我的所有好友。但是当我在搜索栏中搜索任何朋友时,它会显示该搜索列表。我的代码是,
NSString *MY_URL = [NSString stringWithFormat:@"xxxxxxxxxx://host"];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:@"Hi, Check out this app, You'll love it!" forKey:@"message"];
[params setObject:MY_URL forKey:@"link"];
[FBWebDialogs presentRequestsDialogModallyWithSession:FBSession.activeSession
message:@"Friends Invite"
title:@"xxxxxxxx"
parameters:params handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
{
if (!error) {
NSLog(@"Url : %@",resultURL);
NSLog(@"Result : %u",result);
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);
}
}
else
{
NSLog(@"Error : %@",[error localizedDescription]);
}
}];
我的意思是如何在此邀请列表中显示我所有的朋友。
对于 2014 年 4 月之后注册的 Facebook 应用程序,您无法访问所有好友,除非您正在实施 game/canvas 应用程序。 (如果是这种情况,您将需要使用 invitable_friends 端点)
否则,很遗憾,您将只能访问已经登录到您应用的 Facebook 好友用户。
注意:即使您的应用是在 2014 年 4 月之前创建的,所有朋友在 2015 年 4 月之后都将无用。
For more info in facebook developer
New features available in v2.0
Taggable Friends API: We've added a new endpoint called /me/taggable_friends that you can use in order to generate stories that have friends tagged in them, even those friends don't use your app. If you want to use the taggable friends API, your app will require review.
Invitable Friends API: We've added a new endpoint called /me/invitable_friends that you can use to generate a list of friends for someone to invite to your game through a custom interface. This API is only available to apps that are games on Facebook Canvas.