Using XMPP Framework for iOS: Receiving presence when a subscriber becomes available/unavailable -
i'm trying implement of delegate methods of xmppstream class, 1 of xmppstream:(xmppstream *)sender didreceivepresence:(xmpppresence *)presence
. have 2 users registered, , both subscribed each other's presence notifications. thing noticed is, didreceivepresence
method called when user authorizes. disconnecting and/or connecting user doesn't notify subscriber it. can receive notifications when i'm subscribed goes offline/online? code use send presence xmppstream is:
- (void) goonline { xmpppresence *presence = [xmpppresence presence]; [_stream sendelement:presence]; } - (void) gooffline { xmpppresence *presence = [xmpppresence presencewithtype:@"unavailable"]; [_stream sendelement:presence]; }
actually setup correct, wasn't subscribed user's presence notifications, thought if in roster i'd notifications automatically. don't forget have accept presence subscription request using acceptpresencesubscriptionrequestfrom
method. if receive subscription request, user automatically added roster, , added roster, both of won't receive presence messages until don't accept subscription request.
Comments
Post a Comment