Search code examples
androidxmppopenfireuser-presence

Getting presence null in openfire using presence.jar


I am creating an android chat application.I am getting null as presence if user is online by using this url :http://localhost:9090/plugins/presence/status?jid=8439198269@localhost&type=text

If user is offline the presence is returned as Unavailable

The other side is when i login through Spark client the presence is shown as online whereas when login with mobile user status is shown as null

The user status is displayed correctly in openfire admin panel but returning wrong presence

Please tell me why it is happening..


Solution

  • First of all, presence plugin takes 3 params. 3rd one is "req_jid".

    In XMPP, you can request the presence of user only if you have subscribed to his presence and the user has allowed it.

    But for Presence plugin, you can override that. Just define this property and you can query any user's presence.

    plugin.presence.public = true