首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Facebook Graph请求

Facebook Graph请求
EN

Stack Overflow用户
提问于 2015-10-11 21:37:14
回答 1查看 393关注 0票数 0

我的应用程序在为端点我向Facebook发出GET请求时收到了一个错误。

这是我的代码:

代码语言:javascript
复制
-(void) updateUserInformation{
    FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"/me:" parameters:@{@"fields": @"id, name, email, user_birthday"}];

    [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
        if(!error){
            NSDictionary *userDictionary = (NSDictionary *)result;
            NSMutableDictionary *userProfile = [[NSMutableDictionary alloc] initWithCapacity:8];

            if (userDictionary[@"name"]) {
                userProfile[@"name"] = userDictionary[@"name"];
            }

            if (userDictionary[@"first_name"]) {
                userProfile[@"first_name"] = userDictionary[@"first_name"];
            }

            if (userDictionary[@"location"][@"name"]) {
                userProfile[@"location"] = userDictionary[@"location"][@"name"];
            }

            if (userDictionary[@"gender"]) {
                userProfile[@"gender"] = userDictionary[@"gender"];
            }

            if (userDictionary[@"birthday"]) {
                userProfile[@"birthday"] = userDictionary[@"birthday"];
            }
            if (userDictionary[@"interested_in"]) {
                userProfile[@"interested_in"] = userDictionary[@"interested_in"];
            }

            [[PFUser currentUser] setObject:userProfile forKey:@"profile"];

            [[PFUser currentUser] saveInBackground];

        }else {
            NSLog(@"Error in Facebook Request %@", error);
        }

    }];
}

我得到的错误是:

代码语言:javascript
复制
2015-10-11 14:30:59.306 MatchedUp[2358:139193] Error in Facebook Request Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=803, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
    body =     {
        error =         {
            code = 803;
            "fbtrace_id" = "CfGbwnx4/B9";
            message = "(#803) Some of the aliases you requested do not exist: me:";
            type = OAuthException;
        };
    };
    code = 404;
}, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=404, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=(#803) Some of the aliases you requested do not exist: me:, com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0}

我不太清楚这个错误意味着什么。它说“您请求的一些别名不存在: me:”这是否意味着completionHandler中的结果字典不包含端点me的一些信息?任何帮助都将不胜感激。谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-11 21:53:43

尝试将图形路径@"/me:"更改为@"me"

祝好运!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33070359

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档