powered by Jive Software

getPresence works, and sometimes it doesent


I am trying to use getPresence from the rosterEntry class on my rosterlist I´m fetching from a openfire server. 20% of the time it works when i log on. But the rest of the time i just get the “unavailable” status from the server, on all the entries om the roster, even though the entries on the rosterlist are available.

Any of you who knows why this is happening?

Thnaks alot.

Let’'s wait for the answer together.

Best regards

Note that presence information is received asynchronously. So, just after logging in to the server, presence values for users in the roster may be unavailable even if they are actually online. In other words, the value returned by this method should only be treated as a snapshot in time, and may not accurately reflect other user’'s presence instant by instant. If you need to track presence over time, such as when showing a visual representation of the roster, consider using a RosterListener.

http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/ smack/Roster.html#getPresences(java.lang.String)

Best regards