2

I am using Facebook Login version 4.0.1 for iOS, and I would like to clear session/ token programatically when I logout of my application. But I am unable to do so. I am importing

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

but still I am unable to find a solution. In the previous version we could clear the token from FBSession. But in the new version I am unable to get the FBSession. Please help.

Thanks

Jinu Kurian
  • 21
  • 1
  • 6
  • What problem are you having? Be specific. – rmaddy Apr 09 '15 at 03:03
  • I am using Facebook as a login method for my app.But I am unable to logout of Facebook using my application. – Jinu Kurian Apr 09 '15 at 03:32
  • But why can't you? Do you not know how? Are you getting a compiler error? Does your app crash? Or does your app simply not work as expected? As I said, be specific. Simply saying you are unable is the opposite of being specific. Update your question with relevant details about your issue. – rmaddy Apr 09 '15 at 03:34
  • I don't know how to logout. In the previous version we could clear the token from FBSession. But in the new version I am unable to get the FBSession. – Jinu Kurian Apr 09 '15 at 03:39

1 Answers1

4

If you take a look at the changelog for the FB SDK it states that FBSession and FBAccessTokenData are replaced by FBSDKLoginManager.

If you then take a look at FBSDKLoginManager, reference, it states that

FBSDKLoginManager provides methods for logging the user in and out.

Via this method you should be able to log the user out. Does the login button not automatically change to a logout button when the user is logged in?

Chris
  • 7,830
  • 6
  • 38
  • 72
  • The method is `logout` – youssman May 04 '15 at 09:40
  • i tried this but doesnot works : var accesstoken: FBSDKLoginManager = FBSDKLoginManager() accesstoken.logOut() – LC 웃 May 07 '15 at 06:35
  • no sorry..i figured it out later..that user is not completely logged out from the app...http://stackoverflow.com/questions/30092610/facebook-logout-is-not-working-in-new-sdk-v-4-1-0-in-ios/30093967?noredirect=1#comment48304924_30093967 – LC 웃 May 08 '15 at 07:20