Reputation: 203
I'm using an FBSDKLoginButton
. The problem is that I'm always logged in to facebook within the app. Even if I close the app, and go to the facebook app... ensure I'm logged out there... whenever I open my app and get to the log in button, it is greyed out with "Log out" written... not only that but I'm able to present an FBSDKShareDialog
and post
to facebook... even though the facebook app says I'm logged out.
How do terminate my app's facebook access? Right now all I can do is completely delete the app from the iphone to terminate access.
Appreciate any help.
Upvotes: 0
Views: 246
Reputation: 632
To check if you are already logged into Facebook you have to check if the facebookToken is still active or not, like this;
if ([FBSDKAccessToken currentAccessToken]==nil)
{
//not logged in
}
And to logout from Facebook when you close the application you have to call;
FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
[loginManager logOut];
You can call that logout option wither at AppDelegate.h - (void)applicationWillTerminate:(UIApplication *)application
method or manually by placing a application logout button.
Hope this helps :)
Upvotes: 1