在 FBConnect 的新 Graph API 中恢复会话
我在互联网上搜索了这个问题的答案,但找不到。
仅使用 FBConnect 最新 SDK 的新图形 API 如何“恢复会话?”
在旧的 SDK 和 API 中,您可以调用类似 [sessionresume] 的内容;这将恢复您的会话。我找不到任何与新 SDK/API 兼容的等效项。
[会议简历];不起作用。
[会话是否有效];将测试会话的有效性,但不会恢复它。
现在,我唯一想做的就是让用户每次使用该应用程序时都进入该应用程序的授权页面。然而,这很烦人,因为用户最初授权该应用程序后,每次返回页面时都会显示:“您已经授权[应用程序名称]应用程序”,然后您可以点击“确定”,它会将您发送回具有有效会话的应用程序。 *我在互联网上看到过其他帖子,其他开发人员也不得不使用相同的过程,因为他们也找不到答案。
如果有人有任何答案,请分享。但是,由于此问题专门针对新的图形 API 和新的 SDK,因此包含旧 API 或 SDK 的代码/指令的答案将被删除。
I have scoured the internet looking for an answer to this question and can't find one.
Using ONLY the new graph API for FBConnect's newest SDK how do you "resume a session?"
In the old SDK and API, you could call something like [session resume]; and that would resume your session. I can't find any equivalent that works with the new SDK/API.
[session resume]; does not work.
[session isSessionValid]; will test the validity of the session, but will not resume it.
Right now, the only thing I think of to do is have the user go to the authorization page for the app each time they use it. However, this is annoying as after the user initially authorizes the app, each time it returns to the page it states: "You have already authorized [name of app] app" and then you can hit okay, and it sends you back to the app with a valid session. *I have seen other posts around the internet where other developers have had to use this same process because they couldn't find the answer either.
If anybody has any answers, please share them. However, because this question is specifically for the new graph API and new SDK, answers that include code/instructions for the old API or SDK will be deleted.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 fbdidLogin 中,
每次加载应用程序时,恢复这些密钥并使用它们创建一个 facebook 对象:
然后使用该对象上的 isSessionValid 。如果它有效,请继续使用同一个对象执行您的图形 API 业务。如果没有则进行正常授权。这对我来说非常有用。希望有帮助。
In the fbdidLogin do
Every time your app loads recover these keys and create a facebook object with them:
Use then the isSessionValid on that object. If it is valid, just go ahead and do your graph API business with that very same object. If not then do the normal authorize. It works great for me. Hope it helps.