XMPP iOS Framework detect internet disconnection issue with OpenFire server
Asked Answered
N

1

10

I have implemented chatting application using XMPP iOS Framework with OpenFire server.

Fortunately, application is running successfully but I am facing one issue of internet disconnection in application.

When user is getting logout or went in offline mode manually then it sends stanza to his/her rosters. So his/her rosters knows that user went in offline mode.

Now when internet will disconnect from user's device at that time application is not able to send presence stanza to server due to internet disconnection. So his/her rosters won't get information about that offline user and user will be shown in online mode only.

I thought something like OpenFire server might be able to check connected users and whenever any user gets disconnected it should send presence stanza with offline status to his rosters so they can know that this user is on offline mode.

Can anybody please help me if there is any way through which I can implement this feature.

It will be very helpful for me to solve this issue.

Thanks in advance.

Neuromuscular answered 13/5, 2015 at 7:40 Comment(4)
Hi...Cant you check the internet connection at your end, and if so then you can send the offline status of a particular user to all his/her friends....I mean if its not working with the library we can manually check the connections and take required steps.Alvie
@Alvie I can check internet connection at my end but I can not send status to other friends because internet connection is lost :(Neuromuscular
Have you guys any solution for above question?Sotos
@Sotos you can use reachability manager to detect internet disconnection and presence unavailable feature of Openfire.Neuromuscular
G
4

It's the core xmpp feature and Openfire must send unavailable to your contacts on your behalf. So it looks like a bug. But there is a different problem - users with mobile internet may reconnect too often, and XMPP community developed a Stream Management extension, which allow server to "hibernate" client session when it quickly reconnect and restore it without presence changes. Summarize:

  1. Check if Stream Management is active - in this case user will still online fixed amount of time (typically 5 minutes) and then go offline.
  2. Check if Openfire implements any non-standard extension to maintain user session.
  3. If you are sure none of extensions are "hibernating" user session - then it is a really bug. Try the same with different xmpp server - good candidates are ejabberd and prosody
Giarla answered 19/5, 2015 at 7:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.