簡體   English   中英

Android:如何在quickblox中獲取在線或離線用戶狀態?

[英]Android: How to get online or offline user status in quickblox?

我無法在quickblox中獲得用戶離線和在線狀態。 在quickblox的簡單聊天演示中。 我正在使用演示進行聊天。 但那在我無法讓用戶在線離線狀態。 我已經搜索並引用了許多鏈接,但沒有獲得成功。 謝謝提前。

Reffed鏈接:

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 /開發商/ Android_XMPP_Chat_Sample#指南:_Getting_Started_with_Chat_API

使用以下代碼將幫助您。

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());
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM