Facebook iOS SDK v 3.1.1遇到问题 [英] having trouble with Facebook iOS SDK v 3.1.1

查看:153
本文介绍了Facebook iOS SDK v 3.1.1遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序现在使用iOS的Facebook SDK版本3.1.1.

My app is now using the Facebook SDK version 3.1.1 for iOS.

在iOS6上,我注意到FBSession expirationDate的异常行为.该日期始终设置为4001年(遥远的未来?).我已经读到这可能与offline_access权限有关,但我们并没有要求(我们曾经在应用程序的一个很旧的版本中这样做.但这是在干净的映像上进行的全新安装.)

On iOS6 I'm noticing strange behavior with the FBSession expirationDate. The date is always set to the year 4001 (distant future?). I've read that this can be related to offline_access permission but we're not asking for that (we did at one time, in a very old version of the app. But this is a fresh install on a clean image.)

根据FB SDK准则,我们总是始终首先通过FBSession openActiveSessionWithReadPermissions要求基本的读取权限.返回的会话到期日期始终为4001-01-01.稍后,当我们要发布时,我们呼叫FBSession reauthorizeWithPublishPermissions,要求输入publish_action.

Per the FB SDK guidelines we always ask for basic read permissions first via FBSession openActiveSessionWithReadPermissions. The session expiration date returned is always 4001-01-01. Later, when we want to post, we call FBSession reauthorizeWithPublishPermissions, asking for publish_action.

在令牌过期之前,这一切似乎都可以正常工作.我只注意到expirationDate问题,因为我发现我们正在将过期的令牌传递给图API,而这些调用失败了.

This all seems to work fine until the token expires. I only noticed the expirationDate issue because I found that we were passing expired tokens to the graph API, and those calls were failing.

但这不应该发生,对吧? -每当应用开始变冷时,我们就会调用FBSession openActiveSessionWithReadPermissions,而每当应用启动时,我们就会调用FBSession handleDidBecomeActive.刷新任何过期的活动令牌应该是正确的,是吗?

But this shouldn't happen, right? - whenever the app starts cold we're calling FBSession openActiveSessionWithReadPermissions, and whenever the app becomes active we call FBSession handleDidBecomeActive. This should be correct to refresh any expired active token, yes?

我可能做错了什么,需要检查哪些内容?为什么将expirationDate设置为4001?

What am I likely doing wrong, and what are some things to check? And why is the expirationDate set to 4001?

修改:

我认为我的问题与此处描述的内容有关:适用于Facebook iOS SDK的openActiveSession之后过期的访问令牌

I think my issue is related to what is described here: Expired access token after openActiveSession for Facebook iOS SDK

我没有使用任何FB SDK支持来调用图形API.因此,我没有利用明显内置的SDK支持来刷新iOS6管理的令牌.

I'm not using any of the FB SDK support for calling the graph API's. So I'm not taking advantage of the apparently built-in SDK support for refreshing the iOS6-managed token.

编辑2 :

我认为这与我的问题完全相同:

I think this is an exact duplicate of my issue:

iOS 6 Facebook登录未刷新访问令牌

也在此处引用: http://developers.facebook.com/bugs/441739699216684 ?browse = search_5099512da57214b73000801

推荐答案

事实上,offline_access权限确实返回了在4001年到期的auth令牌.

The offline_access permission did in fact return an auth token that expired in the year 4001.

到目前为止,根据我的经验,iOS 6的本机FB身份验证始终会返回一个令牌,该令牌的到期日期也记录在您的应用程序的plist中(也就是4001年),但其实际到期日期却大不相同. href ="https://developers.facebook.com/tools/debug" rel ="nofollow"> FB令牌调试器.简而言之,不要依赖手机上存储的值.不知何故断开连接.

In my experience so far, iOS 6's native FB auth always returns a token whose expiration date is recorded (in your app's plist) as the year 4001 as well, but whose actual expiration date is much different, according to the FB token debugger. In short, don't rely on the value stored on the phone. Somehow there's a disconnect.

我也和您一样(调用FBSession openActive ...和handleDidBecomeActive)具有相同的假设,即通过调用这些方法来刷新令牌,但这对我也没有帮助.

I too had the same assumptions as you did (calling FBSession openActive... and handleDidBecomeActive) about my token getting refreshed by calling those methods, but that didn't pan out for me either.

在您的更新中,您链接到我提出的类似问题,而我刚刚添加了解决方案.您可以在这里查看: http://facebook.stackoverflow.com/Questions/13125430/ios-6-facebook-login-not-refreshing-access-token#answer-13298770

In your updates, you linked to a similar question I posed, and I just added my solution. You can check it out here: http://facebook.stackoverflow.com/questions/13125430/ios-6-facebook-login-not-refreshing-access-token#answer-13298770

希望这会有所帮助!

这篇关于Facebook iOS SDK v 3.1.1遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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