开发者

fbconnect logout button iphone sdk

开发者 https://www.devze.com 2023-01-16 14:47 出处:网络
i h开发者_开发知识库ave 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

i h开发者_开发知识库ave 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消