本文介绍了FBSDKGraphRequest使用未声明的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管我已经导入了FacebookSDK,例如:#import <FacebookSDK/FacebookSDK.h>,但是它说:使用未声明的标识符'FBSDKGraphRequest'.

Though I have imported FacebookSDK like: #import <FacebookSDK/FacebookSDK.h>, but it says:use of undeclared identifier 'FBSDKGraphRequest'.

我写的代码很简单:

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                                      initWithGraphPath:@"/{user-id}/albums"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                              id result,
                                              NSError *error) {
            // Handle the result
        }];

让我知道我可能会丢失什么?

Let me know what may I be missing?

推荐答案

自版本4.X开始,Facebook将该SDK分为3部分:

Since version 4.X Facebook has split the SDK in 3 parts:

每个文档:

FBSDKCoreKit提供了核心SDK 功能,例如Graph API请求,访问令牌和App 见解.

FBSDKCoreKit provides core SDK functionality such as Graph API Requests, access tokens, and App Insights.

FBSDKLoginKit提供了用于登录人员的功能,并且 只需要FBSDKCoreKit.

FBSDKLoginKit provides functionality to log people in, and only requires FBSDKCoreKit.

FBSDKShareKit提供了以下功能 共享,只需要FBSDKCoreKit.

FBSDKShareKit provides functionality to share, and only requires FBSDKCoreKit.

关于您的问题:

因此,基本上,您需要在文件中导入FBSDKCoreKit:

So basically you need to import FBSDKCoreKit in your file:

#import <FBSDKCoreKit/FBSDKCoreKit.h>

这篇关于FBSDKGraphRequest使用未声明的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 19:31