由API无效的随机Facebook

由API无效的随机Facebook

本文介绍了由API无效的随机Facebook iOS SDK身份验证令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Facebook iOS SDK从我的iPhone访问图表时随机收到以下消息:

I randomly get the following message when trying to access the graph from my iPhone using Facebook iOS SDK:

我不确定为什么这是因为我在登录后立即调用图表,所以令牌应该有效。此外,这种情况在30%的时间内随机发生。有谁知道如何调试这个问题?

I'm not sure why this is because I call the graph immediately after I login, so the token should be valid. Also, this happens randomly around 30% of the time. Does anyone know how to go about debugging this issue?

推荐答案

我遇到了同样的问题。在成功注销回调后立即调用授权后,任何图形请求都会发生(想法是不同的用户可以从那里登录)。

I've been experiencing the same issue. It happens with any graph request after calling authorize immediately after a successful logout callback (with the idea being that a different user can log in from there).

授权屏幕将说用户已经接受了权限(即使他们现在应该被注销......)如果他们点击确定它将导致问题。几乎就像auth进程重新发出一个无效的令牌,因为它没有得到他们已经注销的备忘录。但是,如果用户点击不是你?就不会发生这种情况。链接并按预期以其他人身份登录(或者如果他们再次以同一用户身份登录),所以这不是我的主要问题。

The authorization screen will say that the user's already accepted the permissions (even though they're supposed to be logged out now...) and if they hit ok it will cause the issue. Almost as if the auth process reissues an invalidated token because it doesn't get the memo that they've logged out. However it won't happen if the user hits the "not you?" link and logs in as someone else as intended (or if they log in again as the same user), so this isn't a major issue in my case.

As对于答案/修复,我通过检测图形调用中的错误响应然后再次进行授权调用来自我修复。虽然不太理想,因为它会让用户连续两个应用程序切换... ...

As for an answer / fix, I made mine fix itself by detecting the error response from the graph call and then making another call to authorize. Not ideal though, since it annoys the user with two consecutive app switches...

这篇关于由API无效的随机Facebook iOS SDK身份验证令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 00:38