In the new Facebook iOS SDK, the entire login process has been revamped. The old [FBSession activeSession].isOpen
trick doesn't work anymore. How can I reliably determine the state of a user's session in the new SDK?
My current thoughts are simply checking if [FBSDKProfile currentProfile]
is nil, but that doesn't seem like it would be 100% accurate, or the proper, most direct way to solve this problem.
There are some changes on v4.0. You can check all of them here: https://developers.facebook.com/docs/ios/upgrading-4.x
In order to check user's session, now you should use [FBSDKAccessToken currentAccessToken]
.
FBSession.activeSession
has been replaced with[FBSDKAccessToken currentAccessToken]
andFBSDKLoginManager
. There is no concept of session state. Instead, use the manager to login and this sets thecurrentAccessToken
reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With