facebookErrDomain错误10000当调用图表api Facebook ios [英] facebookErrDomain error 10000 when calling graph api Facebook ios

查看:144
本文介绍了facebookErrDomain错误10000当调用图表api Facebook ios的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在努力与图表api几天,我似乎无法再进一步。

I'm struggling with the graph api for a few days now and I can't seem to get any further.

在我的appdelegate中,我把以下代码在didFinishLaunching中

In my appdelegate i've placed the following code within the didFinishLaunching

facebook = [[Facebook alloc] initWithAppId:@"cut-app-id-out"];

    NSArray* permissions =  [[NSArray arrayWithObjects:
                              @"email", @"user_location", @"user_events", @"user_checkins", @"read_stream", nil] retain];

    [facebook authorize:permissions delegate:self];


    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
                                   @"test message from stackoverflow", @"message",                             
                                   nil];

    [facebook requestWithGraphPath:@"/me/feed" andParams:params andDelegate:self];

您可以看到我正在尝试让用户提供。我使用以下代码将数据放入适当的字典。

as you can see i'm trying to get the users feed out. I use the following code to place the data into a proper dictionary.

- (void)request:(FBRequest*)request didLoad:(id)result
{

    if ([result isKindOfClass:[NSDictionary class]]) {
        NSLog(@"count : %d ", [result count]);
        NSArray* resultArray = [result allObjects];

        NSLog(@"count : %d ", [result count]);
        result = [resultArray objectAtIndex:0];

        NSLog(@"count : %d ", [result count]);
        result = [result objectAtIndex:0];

    }
}

但是didFailWithError:函数给了我以下错误:
无法完成操作。 (facebookErrDomain error 10000。)

But the didFailWithError: function gives me the following error: The operation couldn’t be completed. (facebookErrDomain error 10000.)

我将FBRequestDelegate放在我的界面文件中,如下所示:

I've place the FBRequestDelegate in my interface file as following:

@interface TabbedCalculationAppDelegate : NSObject 
            <FBRequestDelegate>{



Is there something what i'm missing?

推荐答案

特别是在授权之后,还需要处理Facebook回复。您将无法在授权方法之后立即致电Facebook API。请参阅他们的示例代码其中显示了如何响应您需要做的各种事件,最重要的是 fbDidLogin fbDidNotLogin 。只有一次登录成功后才能访问Graph API。

There's a lot more needed to handle Facebook responses, especially after authorization. You're not going to be able to make calls against the Facebook API immediately after the authorize method. Please see their sample code which shows how to respond to the various events which you will need to do, most importantly the fbDidLogin and fbDidNotLogin ones. Only once you have a successful login should you access the Graph API.

此外,您似乎试图使用Graph API发布消息。不幸的是,这不是这样做,而是像 [facebook requestWithGraphPath:@me / feedandDelegate:self]; 之类的电话是为了只读使用。再次,看一下如何使用 publish_stream 权限的示例(他们的代码有一个 publishStream 示例方法)。

In addition, it looks like you're trying to post a message with the Graph API. Unfortunately that's not the way to do it and a call like [facebook requestWithGraphPath:@"me/feed" andDelegate:self]; is meant for read-only use. Again, look at the above link for an example of how to use the publish_stream permission (their code has a publishStream example method).

这篇关于facebookErrDomain错误10000当调用图表api Facebook ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆