fbconnect 注销按钮 iphone sdk
我有 fbconnect sdk 的默认登录按钮。我点击它并连接,然后我在我的 Facebook 个人资料中发布一些内容。当帖子完成后,我看到按钮已更改为注销。我如何检测用户何时按下注销按钮以消失我的 uiview 上的另一个按钮?
i have the default login button of fbconnect sdk . i tap it and i connect then i post to my facebook profile something. when the post is finished i see that the button has changed to logout . how can i detect when the user presses the logout button in order to dissapear another button i have on my uiview?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最明显且最简单的方法是了解按钮的状态。如果用户已经登录,按钮的状态将显示“注销”,当用户单击它时,您只需处理事件并调用注销即可。
现在,您如何知道用户已登录? FBSession 类中的 FBConnect 中有一个方法。
[_session isConnected];
如果用户已登录,则返回 true;如果用户未登录,则返回 false。我认为您已经将会话变量存储在某个地方来调用登录The obvious and easiest way is to know what is the status of the button. If the user is already loggined, the status of the button will say "Log out", and when user clicks on it, you just handling the event and call logout.
Now, how can you know that user is loggined? There is a method in FBConnect in FBSession classes.
[_session isConnected];
returns true if user is loggined and return false if user is not. And I think that you already have stored your session variable somewhere to call login