Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User shows online in OpenFire, even app is in background OR in kill state

We are using XMPPFramework & Openfire(Version: 4.6.2) for our application.

After killing the application or putting it into background mode, it still shows that the user online for few minutes, then after it became offline.

We have tried with Idle Connections Policy time but still got nothing.

Suggestions will be welcomed.

like image 773
Rahul Patel Avatar asked Jun 10 '21 14:06

Rahul Patel


1 Answers

I have faced similar issue in a project and after investigation it was found that it happens when using Stream Resumption feature (Stream Management XEP-0198).

If stream resumption is enabled when starting a new stream, Openfire will not immediately mark the user as Offline, instead it's session will be marked in Detached state. So the client app can resume the stream again without having to do full login.

If you will not use Stream Resumption, user will immediately become offline.

When enabling Stream Management, if client sends following packet, resumption feature is enabled on the stream.

<enable xmlns='urn:xmpp:sm:3' resume='true'/>

For this packet, server acknowledges by sending back:

<enabled xmlns='urn:xmpp:sm:3' id='some-long-sm-id' resume='true'/>
like image 88
Shoaib Ahmad Gondal Avatar answered Oct 11 '22 01:10

Shoaib Ahmad Gondal