我正在使用以下 Graph API 请求来获取所有喜欢特定对象的朋友:
me/?fields=friends.fields(likes.target_id(searched_object_id))
iOS代码如下:
[ FBRequestConnection startWithGraphPath: [ NSString stringWithFormat: @"me/?fields=friends.fields(name,likes.target_id(%lld))", 7919071058 ]
completionHandler: ^(FBRequestConnection *connection, id result, NSError *error) {
[ [ [ result objectForKey: @"friends" ] objectForKey: @"data" ] enumerateObjectsUsingBlock:^(id friend, NSUInteger idx, BOOL *stop) {
if ( [ friend objectForKey: @"likes" ] )
NSLog( @"%@ also likes that", [ friend objectForKey: @"name" ] );
} ];
}
];
不幸的是,我想对 og.likes 做同样的事情 .target_id 不可用
有关信息 og.likes 是开放图形对象,您可以在您的应用程序中声明。(https://developers.facebook.com/docs/opengraph/tutorial/)
提前感谢您的帮助