要在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> 

enter image description here

+0

其SDK您使用的? – 2015-04-01 14:25:15

+0

FacebookSDK for iOS – 2015-04-01 14:26:37

+0

版本?是不是4.0 – 2015-04-01 14:27:17

,因为它是在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

+0

你有没有收到你的朋友名单? – 2015-04-02 04:51:17

+0

当我声明FBSDKGraphRequest *请求时,它说'使用未识别的标识符FBSDKGraphRequest'。虽然我也导入了,但可能是什么问题? – 2015-05-21 12:54:02

+0

@ChanchalRaj尝试使用#import ,因为它在更新的版本中被更改 – 2015-05-21 13:24:47