Set presence as unavailable - Facebook Chat API

228 views Asked by At

I'm using xmppframework to develop my xmpp client. I make a normal login in Facebook, after that i setup my xmppStream to connect my client with the facebook chat and then, I send the initial presence as:

NSXMLElement *presence = [NSXMLElement elementWithName:@"presence"];
[self.xmppStream sendElement:presence];

After that, I decided to implement the opposite behavior (set presence as offline), To do this, I have the following code:

NSXMLElement *presence = [NSXMLElement elementWithName:@"presence"];
[presence addAttributeWithName:@"type" stringValue:@"unavailable"];
[self.xmppStream sendElement:presence];

The first piece of code works and I'm visible to everyone after run it. However, when I try to set my account offline, it doesn't work. Basically, Facebook ignores my message.

Anybody have an idea how can i solve this?

1

There are 1 answers

0
Tiago Pereira On BEST ANSWER

Solved. The code is correct. There is a delay before the user appears as unavailable in the facebook (+/- 2 minutes).