使用Facebook ios SDK在应用中注销Facebook [英] Logout of Facebook in app using Facebook ios SDK
问题描述
- (IBAction)btnlogOutClicked:(id)sender
{
[appDelegate fbDidlogout];
}
- (void)fbDidlogout
{
FBSession * session = [FBSession activeSession];
[session closeAndClearTokenInformation];
[session close];
[FBSession setActiveSession:nil];
}
但是当我再次点击按钮I m重新定向到我的帐户,而不用进入Facebook登录页面。
如何注销Facebook?
使用新的Facebook SDK登录套件,只需在下面写下即可。
[FBSDKLoginManager new] logOut];
如果使用swift,请确保有必要进口
import FBSDKLoginKit
func logout(){
FBSDKLoginManager()。logOut )
}
I have integrated Facebook login in my app and therfore user can login with both my app account and also Facebook and do corresponding actions.For Facebook integration I have added Facebook SDK.Now when Logout button is clicked in my app it has to clear all the credentials of Facebook Account.I have gone for :
-(IBAction)btnlogOutClicked:(id)sender
{
[appDelegate fbDidlogout];
}
-(void)fbDidlogout
{
FBSession* session = [FBSession activeSession];
[session closeAndClearTokenInformation];
[session close];
[FBSession setActiveSession:nil];
}
But when I again click on button I m redirected directly to my account without going to Facebook Login page.
How can I logout of Facebook?
Using new Facebook SDK login kit just write below line and thats it..
[[FBSDKLoginManager new] logOut];
If using swift, make sure to have the necessary imports
import FBSDKLoginKit
func logout() {
FBSDKLoginManager().logOut()
}
这篇关于使用Facebook ios SDK在应用中注销Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!