ios-Facebook SDK 3.0发布状态更新时出错5 [英] ios-Facebook SDK 3.0 Error 5 When Posting Status Update

查看:93
本文介绍了ios-Facebook SDK 3.0发布状态更新时出错5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用新的(测试版)ios sdk 3.0在应用程序中添加Facebook集成。所有我想要发布的状态更新到Facebook。我用FBLoginView登录到Facebook。我把我的应用程序id放在plist的指示在Facebook上。我把一些代码发贴到Facebook。

I am trying out adding facebook integration in an app using the new (beta) facebook ios sdk 3.0. All I would like to is post a status update to facebook. I used a FBLoginView to login to facebook. I put my app id in the plist as instructed on facebook. I put in some code to post to facebook.

(void)viewDidLoad
{
[super viewDidLoad];
NSArray *perms;
perms = [NSArray arrayWithObjects:@"status_update", nil];
FBLoginView *loginview = 
[[FBLoginView alloc] initWithPermissions:perms];

loginview.frame = CGRectOffset(loginview.frame, 5, 5);
loginview.delegate = self;

[self.view addSubview:loginview];
// Do any additional setup after loading the view, typically from a nib.

}

- (IBAction)poststatus:(UIButton *)sender {
NSString *message = [NSString stringWithFormat:@"Test staus update"];

[FBRequestConnection startForPostStatusUpdate:message
                            completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {

                                [self showAlert:message result:result error:error];

                            }];
}
- (void)showAlert:(NSString *)message
       result:(id)result
        error:(NSError *)error {

NSString *alertMsg;
NSString *alertTitle;
if (error) {
    alertMsg = error.localizedDescription;
    alertTitle = @"Error";
} else {
    NSDictionary *resultDict = (NSDictionary *)result;
    alertMsg = [NSString stringWithFormat:@"Successfully posted '%@'.\nPost ID: %@", 
                message, [resultDict valueForKey:@"id"]];
    alertTitle = @"Success";
}

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:alertTitle
                                                    message:alertMsg
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
[alertView show];
}

奇怪的是,这段代码工作于ONCE。第一次验证用户后,我可以成功发送一个状态更新。之后,所有后续尝试将失败,并显示FBiOSSDK错误5(在控制台中,错误:HTTP状态代码为400)。解决此问题的唯一方法是从Facebook帐户中删除该应用程序并重新验证。我不知道问题是什么。我在网上查找解决方案,但找不到任何东西。如果有人知道如何解决这个问题,请让我知道。谢谢

The odd thing is, this code works ONCE. After authenticating the user for the first time, I can post ONE status update successfully. After that, all subsequent attempts will fail with a FBiOSSDK error 5 (in the console, Error: HTTP status code:400). The only way to fix this is to remove the app from the facebook account and re-authenticate. I'm not sure what the problem is. I looked online for solutions but couldn't find anything. If anyone knows how to fix this, please let me know. Thanks

推荐答案

似乎可能没有答案的问题。我已经检查了带有SDK的FB样本,在这些例子中也发生同样的错误。所以这意味着在几乎没有状态更新(15-20)Facebook达到该特定用户的限制之后。如果您退出该用户并以其他用户身份登录,则可以成功发布。

It seems there might be no answer to the issue. I have checked FB samples coming with SDK, in these examples also the same error happens. So it means after few status updates (15-20) Facebook reaches limits for that particular user. If you log-out for that user and log-in as another user, you can successfully post.

如果我找到任何扩展限制设置,我将回复。
另外Facebook不允许同一篇文章。

If I will find any extension to limit settings I will reply. Also Facebook doesn't allow for the same Post.

这篇关于ios-Facebook SDK 3.0发布状态更新时出错5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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