Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 399
Avi Shukron Avatar asked Nov 29 '25 03:11

Avi Shukron


1 Answers

  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.

like image 78
Mike Bretz Avatar answered Nov 30 '25 18:11

Mike Bretz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!