要在iOS中使用Facebook Graph API导入什么内容?
我需要用户好友列表。我明白如何从应用程序按钮登录到FB。但现在我不能碰到这条线:要在iOS中使用Facebook Graph API导入什么内容?
我应该导入哪个头文件来使用Graph API?
/* make the API call */
[FBRequestConnection startWithGraphPath:@"/{friendlist-id}"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
我安装的框架见下文,并包括一些标题。但看不到任何图表的东西。
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
,因为它是在SDK 4.0
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/friends" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@”fetched user:%@”, result);
}
}];
更新尝试使用这种方法请参考:https://developers.facebook.com/docs/ios/graph#fetching
你有没有收到你的朋友名单? – 2015-04-02 04:51:17
当我声明FBSDKGraphRequest *请求时,它说'使用未识别的标识符FBSDKGraphRequest'。虽然我也导入了
@ChanchalRaj尝试使用#import
其SDK您使用的? – 2015-04-01 14:25:15
FacebookSDK for iOS – 2015-04-01 14:26:37
版本?是不是4.0 – 2015-04-01 14:27:17