Facebook Auth on iOS
iOS beginner here. I am implementing SSO in my iOS app. I've created a Facebook object with
Facebook* faceboo开发者_如何学运维k = [[Facebook alloc] initWithAppId:appId];
[facebook authorize:permissions delegate:self];
How do I stay logged in after the user closes the app? Do I persist this facebook object in Core Data?
You can also use NSUserDefaults
, which is what I have used in the past. You only need to persist the expirationDate
and accessToken
. Once you restore those into the Facebook object on launch, you can call isSessionValid
to determine that validity of both those properties.
精彩评论