我无法在quickblox中获得用户离线和在线状态。在quickblox的简单聊天演示中。我正在使用This演示进行聊天。但那在我无法让用户在线离线状态。我已经搜索并引用了许多链接,但没有获得成功。谢谢你。
Reffed links:
https://github.com/QuickBlox/quickblox-android-sdk/tree/master/sample-chat https://github.com/QuickBlox/quickblox-android-sdk http://quickblox.com/developers/SimpleSample-users-android https://assist.quickblox.com/index.php?/Knowledgebase/Article/View/35/0/how-to-find-out-whether-quickblox-user-is-online https://quickblox.com/developers/Android_XMPP_Chat_Sample#Guide:_Getting_Started_with_Chat_API
答案 0 :(得分:0)
使用以下代码可以帮助您。
Roster roster = xmppConnection.getRoster();
Collection<RosterEntry> entries = roster.getEntries();
Presence presence;
for(RosterEntry entry : entries) {
presence = roster.getPresence(entry.getUser());
System.out.println(entry.getUser());
System.out.println(presence.getType().name());
System.out.println(presence.getStatus());
}