Facebook朋友在iPhone应用程序中的位置信息
问题描述:
任何人有一个想法如何从Facebook个人资料获取Facebook朋友位置的详细信息。Facebook朋友在iPhone应用程序中的位置信息
我使用此图形API获取这些详细信息(id,姓名,性别,电子邮件,图片)。
我还需要位置信息。
谢谢!
答
要获取1.0图形API的朋友位置,可以使用以下代码。
if (FBSession.activeSession.isOpen) {
[FBRequestConnection startWithGraphPath:@"me/friends?fields=name,location,installed,picture"
parameters:nil
HTTPMethod:@"GET"
completionHandler:^(
FBRequestConnection *connection,
NSDictionary<FBOpenGraphObject> *my,
NSError *error
) {
NSDictionary *resultDictionary = (NSDictionary *)my;
if ([resultDictionary valueForKey:@"data"]) {
NSString * latitude = [NSString stringWithFormat:@"%@",[[my2 valueForKey:@"location"] objectForKey:@"latitude"]];
NSString *longitude=[NSString stringWithFormat:@"%@",[[my2 valueForKey:@"location"] objectForKey:@"longitude"]];
}
}];
}
重要提示我/朋友才会回报你,因为图形API 2.0谁已授权您的应用程序在facebook docs这里提到正如提到的,除了像name , id , picture
基本信息为mentioned here
在V1.0中,有可能要求授权将允许 应用查看好友资料,数量有限,例如一个人的 朋友的喜好,他们的生日,等等。
在v2.0中,这些权限全部被删除。它不再 可能的应用,看看从一个人的朋友的数据,除非这些 朋友也登录到应用程序,并获准为 应用程序,看看它的数据
refrer这个你无法获取的朋友在Facebook的新版本2.0中的位置,需要使用此链接http://stackoverflow.com/questions/24859046/ios-list-of-facebook-friends-birthday-using-graph-api/24859147#24859147 – 2014-09-22 07:31:50
https:/ /developers.facebook.com/docs/apps/changelog – luschn 2014-09-22 07:37:09