在接受应用程序原因时选择“不现在”,“com.facebook.sdk error2” [英] Choosing 'Not Now' when accepting app causes "com.facebook.sdk error2"

查看:63
本文介绍了在接受应用程序原因时选择“不现在”,“com.facebook.sdk error2”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Facebook iOS SDK 3.1。

当选择不允许连接到Facebook应用程序时,我被困在Facebook扔com.facebook.sdk error2。

When choosing not to allow a 'Connect' to a Facebook app, I'm stuck with Facebook throwing "com.facebook.sdk error2." errors at me, even after re-installing my app.

重现步骤:


  1. 选择与Facebook连接

  2. 在弹出 UIAlertView
  3. $ b $中选择不现在 b
  1. Choose to connect with Facebook
  2. Select 'Not Now' in the UIAlertView that pops up

=>我无法再选择连接。

=> I can't choose to connect again.

用户连接的唯一方法再次是将其Facebook帐户从设置中删除,然后再次添加。

The only way for the user to connect again is to remove her Facebook account from Settings and add it again.

这是一个在Facebook SDK中的错误或者我错过了什么?

Is this a bug in the Facebook SDK or am I missing something?

我明确地遵循授权教程,一切都可以正常运行(选择连接后,发布内容)。

推荐答案

好的,所以我想出这里有什么。当拒绝该应用的授权时,将其作为设备存储在设备的Facebook帐户(设置> Facebook)中。

OK, so I figured out what goes on here. When declining authorization of the app, this is stored as a setting on your device's Facebook account (Settings > Facebook).

通过转到设置并重新启用相关应用,您可以尝试再次连接。对用户来说不太清楚,但是您可以抓住这个错误并向用户显示某种信息。

By going to Settings and re-enabling the app in question, you can try to connect again. Not very clear to users, but you can catch this error and show some kind of info to the user.

这是我如何实现它(与Facebook的默认错误处理):

This is how I implemented it (compared to Facebook's default error handling):

- (void)sessionStateChanged:(FBSession *)session
                      state:(FBSessionState)state
                      error:(NSError *)error {
....

if (error) {
        NSString *errorTitle = NSLocalizedString(@"Error", @"Facebook connect");
        NSString *errorMessage = [error localizedDescription];
        if (error.code == FBErrorLoginFailedOrCancelled) {
            errorTitle = NSLocalizedString(@"Facebook Login Failed", @"Facebook Connect");
            errorMessage = NSLocalizedString(@"Make sure you've allowed My App to use Facebook in Settings > Facebook.", @"Facebook connect");
        }

        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:errorTitle
                                                            message:errorMessage
                                                           delegate:nil
                                                  cancelButtonTitle:NSLocalizedString(@"OK", @"Facebook Connect")
                                                  otherButtonTitles:nil];
        [alertView show];
    }

}

这篇关于在接受应用程序原因时选择“不现在”,“com.facebook.sdk error2”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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