Facebook iOS SDK: Login to Facebook without always ask for permissions for the application

爷,独闯天下 提交于 2019-12-22 09:56:43

问题


I'm using the Facebook iOS SDK in my application and i have two similar question:

  1. Is there any way to know whether or not there is a user currently logged in?
  2. What i'm using now is storing the access token and expiration date on successful login, and load them when the application start. My question is: If the session is not valid, can i just give the user the option to log in without asking every time for permissions? because right now, every time that i want to login i get the message that i already gave permissions to my app. And I only want to login without this part.

Any ideas?


回答1:


  1. A call to graph.facebook.com/me will return results only in case you have valid auth token. Without an access token you are not logged in, too.
  2. Either request offline_access privilege or just do not use the new login mechanism but a login dialog. The dialog will popover your app and only ask once for privileges.

I'm currently on iPhone, so can not provide code, but have look for the FBDialog methods in SDK.



来源:https://stackoverflow.com/questions/5232063/facebook-ios-sdk-login-to-facebook-without-always-ask-for-permissions-for-the-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!