本文介绍了从Facebook以编程方式注销iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以编程方式从Facebook注销而不使用 FBSDKLoginButton
i已经搜索如何做
i发现这个答案我们可以以程序方式注销Facebook
但问题是 FBSession 在新的iOS FBSDK版本中被弃用



我的问题是
有没有办法在新的iOS FBSDK版本中清除fb会话?如果有任何方法从程序设计方式退出Facebook?
或如何从 FBSDKLoginButton $ / $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
$ p $ )

解决方案

您有两种注销方法。
首先,按照Inder Kumar Rathore的建议

  FBSDKLoginManager * loginManager = [[FBSDKLoginManager alloc] init]; 
[loginManager logOut];

其次是将currentAccessToken设置为nil

  [FBSDKAccessToken setCurrentAccessToken:nil]; 

@cookiemonsta希望第二种方法适合您。


I am trying to logout from Facebook programmatically without using FBSDKLoginButtoni had search how could I doi found this answer Can we logout facebook programaticallybut the problem is the FBSession is deprecated in new iOS FBSDK version

my question isIs there any way to clear the fb session in the new iOS FBSDK version? if there any way to logout from Facebook programmatically?or how could I call the logout action from FBSDKLoginButton

Thanking in advance:)

解决方案

You have two methods to logout.First, as suggested by Inder Kumar Rathore

FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
[loginManager logOut];

Second is by setting the currentAccessToken to nil

[FBSDKAccessToken setCurrentAccessToken:nil];

@cookiemonsta hope second method works for you.

这篇关于从Facebook以编程方式注销iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 00:18