views:

52

answers:

1

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?

A: 

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

vodkhang
thanks man thanks very much
stefanosn