Search code examples
iosfacebook-ios-sdk

Remove integrated account from Facebook iOS SDK


  1. Once I login into the Facebook system using iOS SDK 3.0.
  2. Somehow my application will terminate without calling the logout event.
  3. My current login is active in the browser or webview, and I want to remove that account
    information from the device. How can I remove it? (Programmatically call the logout event when terminating my application).

I tried [FBSession activesession close;], but I am not getting the proper solution.


Solution

  • I got the solution. When your application has crashed and your session is still alive, at that time just check this method:

    if([FBSession activeSession])
    {
        [[FBSession activeSession] closeAndClearTokenInformation];
    }
    

    , in this application delegate:

    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    }