I want to get receiver's presence (online/offline). I am using XMPPFramework and Openfire server for sending chat. But when app is killed, XMPP does not persist connection and hence user goes offline. So, I wish to send push notification to the offline user.
// If user is online
NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
[message addAttributeWithName:@"to" stringValue:chatWithUser];
[message addChild:body];
[self.xmppStream sendElement:message];
// Else when user is offline
// Method for push notification
How can I get the presence of the receiver?