Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Check if user is already logged in using Facebook?

I have started working on an iOS app on Xcode using Swift and storyboards. I have a requirement where on click of a button I will show a user's Facebook profile info on the screen (only if user is signed in using Facebook), but if he is not signed in it will automatically go to login screen and on successful login again the profile view will be shown.

How can I do this?

like image 881
hutututu Avatar asked May 13 '15 18:05

hutututu


1 Answers

in sdk for swift 5 use the next portion of code:

import FBSDKCoreKit

if AccessToken.isCurrentAccessTokenActive {
    print("your session is active")
}
like image 199
RΛUL QUISPE Avatar answered Sep 19 '22 21:09

RΛUL QUISPE