好吧,让我们这样说吧。Facebook 文档令人困惑。为了让他的用户喜欢你必须使用 FQL,代码片段是这样的。
// Query to fetch the active user's friends, limit to 25.
NSString *query =
@"SELECT page_id, type FROM page_fan WHERE uid = me()";
// Set up the query parameter
NSDictionary *queryParam = @{ @"q": query };
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:queryParam
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
NSLog(@"Result: %@", result);
}
}];
这样您就可以获取用户页面 ID。如果您需要其他内容,请查看此处的文档:https ://developers.facebook.com/docs/reference/fql/page_fan