尝试在iOS应用中在Facebook上发布乐谱时的未知方法

时间:2012-06-12 09:01:31

标签: ios facebook facebook-graph-api ios5

我正在使用以下内容针对Facebook分数API发布分数

- (IBAction)postScoreClicked:(id)sender 
{
    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    NSMutableDictionary * dict = [[NSMutableDictionary alloc]init];
    [dict setObject:@"1" forKey:@"score"];
    [[delegate facebook] requestWithMethodName:@"/563645402/scores" andParams:dict andHttpMethod:@"POST" andDelegate:self];
    NSLog(@"Posting a new score...");
}

但是,覆盖request didFailWithError我可以清楚地看到记录以下错误:

Error Domain=facebookErrDomain Code=3 "The operation couldn’t be completed. (facebookErrDomain error 3.)" UserInfo=0x68982d0 {request_args=(
        {
        key = method;
        value = "/563645402/scores";
    },
        {
        key = sdk;
        value = ios;
    },
        {
        key = score;
        value = 1;
    },
        {
        key = "sdk_version";
        value = 2;
    },
        {
        key = format;
        value = json;
    },
        {
        key = "access_token";
        value = VALUE-REMOVED-FROM-POST;
    }
), error_msg=Unknown method, error_code=3}

根据API documentation

  

您可以通过发出HTTP POST请求来发布分数或用户   / USER_ID /得分与app access_token,只要你有   publish_actions权限

在我的登录控制器中,我设置了publish_actions权限,如下所示:

NSArray *permissions = [[NSArray alloc] initWithObjects:
                                    @"user_games_activity", 
                                    @"friends_games_activity",
                                    @"publish_actions",
                                    nil];
            [[myDelegate facebook] authorize:permissions];

不太确定我在这里缺少什么想法?

在Facebook应用控制中心,我的应用已注册为原生/桌面,并归类为游戏

0 个答案:

没有答案