开发者

Facebook Auth on iOS

开发者 https://www.devze.com 2023-03-05 18:40 出处:网络
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];

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消