【问题标题】:Does Facebook SDK distinguish between iOS debug vs release buildFacebook SDK 是否区分 iOS 调试和发布版本
【发布时间】:2015-05-24 08:04:49
【问题描述】:

Facebook 是否区分调试和发布 iOS 版本?在向 iTunes 提交新版本之前,我正在测试我的应用程序。我的应用程序使用在 Facebook 上发布照片的单一权限(即 publish_actions)。奇怪的是,当我使用我的 Facebook 帐户进行测试时,一切正常。但是当我用伙伴的Facebook账号测试时,却没有通过:开发者账号链接到我的Facebook账号;不是我伴侣的。基本上针对以下方法

// Convenience method to perform some action that requires the "publish_actions" permissions.
- (void)performPublishAction:(void(^)(void))action {
    // we defer request for permission to post to the moment of post, then we check for the permission
    if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) {
        // if we don't already have the permission, then we request it now
        NSLog(@"Requesting publish permission");
        [FBSession.activeSession requestNewPublishPermissions:@[@"publish_actions"]
                                              defaultAudience:FBSessionDefaultAudienceFriends
                                            completionHandler:^(FBSession *session, NSError *error) {
                                                NSLog(@"Completion handler returns for permission");
                                                NSLog(@"My Permissions are: %@",session.permissions);
                                                if (!error) {
                                                    NSLog(@"Okay no error");
                                                    action();
                                                } else if (error.fberrorCategory != FBErrorCategoryUserCancelled) {                                                    NSLog(@"ERROR GETTING PERMISSION:: %@",error);
                                                }
                                            }];
    } else {
        NSLog(@"the other route");
        action();
    }

}

action() 永远不会被调用。

线

NSLog(@"My Permissions are: %@",session.permissions);

打印

My Permissions are: (
    "public_profile"
)

还有那行

 NSLog(@"The ERROR IS: %@",error);

打印

The ERROR IS: Error Domain=com.facebook.sdk Code=2 
"The operation couldn’t be completed. com.facebook.sdk:ErrorReauthorizeFailedReasonUserCancelled" UserInfo=0x1702779c0 
{com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorReauthorizeFailedReasonUserCancelled,
 NSLocalizedFailureReason=com.facebook.sdk:ErrorReauthorizeFailedReasonUserCancelled,
 com.facebook.sdk:ErrorSessionKey=<FBSession: 0x170169480, state: FBSessionStateOpen, loginHandler:
 0x100374240, appID: 123456789, urlSchemeSuffix: ,
 tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x17022a740>, expirationDate: 2015-05-19 19:07:02 +0000,
 refreshDate: 2015-03-20 19:07:02 +0000, attemptedRefreshDate: 0000-12-30 00:00:00 +0000, permissions:(
    "public_profile"
)>}

【问题讨论】:

  • 基本上——至少在我看来——我合作伙伴的 Facebook 帐户无法从 Facebook SDK 读取 publish_actions 权限。另外,我的搭档已经允许 Instagram 发帖。但不知何故,我们自己的应用程序没有获得他帐户的许可。
  • 问题解决了吗
  • 我投了赞成票,希望也能在我的回答中得到它

标签: ios iphone facebook facebook-graph-api permissions


【解决方案1】:

SDK 不区分构建配置。您的应用是否通过了登录视图:https://developers.facebook.com/docs/apps/review/login?

【讨论】:

    【解决方案2】:

    不,Facebook 不区分调试和发布 iOS 版本。但问题是,您还没有针对一般用户情绪的应用程序。要使普通用户可以登录,您必须无法在您已注册应用程序的https://developers.facebook.com/ 中使用您的应用程序

    1. 首先转到https://developers.facebook.com/ 并使用您的开发者帐户登录
    2. 点击我的应用,选择你已经注册的应用

    3.单击设置选项并在联系电子邮件选项中输入您的电子邮件并保存更改 4.点击status & review 并设置为yes

    1. 你会看到下面的对话框点击确认

    2. 现在您可以使用任何 facebook 帐户登录

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-23
      • 2011-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多