0

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..

Mohit Gaur
  • 355
  • 1
  • 3
  • 22
  • did you properly setup the code in client? first you need to check from your logs, when you are logged in, are you sending any presence packet? – Farhan Oct 17 '16 at 05:49

1 Answers1

2

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

  • Where i can define the above property?..I will appreciate your response – Mohit Gaur Oct 16 '16 at 19:15
  • And one thing more how a user can subscribe.. i mean in java part how can i send subscribe request to user and how can i accept that request at receiver's end..and thanks in advance.. – Mohit Gaur Oct 16 '16 at 19:22
  • 1
    The properties are basically defined in Openfire database in 'ofProperty' table. You can define those from Admin panel by going to 'System Properties' section. – Shoaib Ahmad Gondal Oct 17 '16 at 05:28
  • the public.presence.public is already set to true...It is showing online presence as null – Mohit Gaur Oct 17 '16 at 12:56