# User’s Online Presence

**URL:** <https://community.sendbird.com/t/user-s-online-presence/2012>\
**Category:** Android\
**Tags:** group-channel, chatsdk\
**Created:** [April 5, 2021, 1:30pm UTC](https://community.sendbird.com/t/user-s-online-presence/2012 "2021-04-05T13:30:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamarjun](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/iamarjun/32/1136_2.png) [@iamarjun](https://community.sendbird.com/u/iamarjun)\
**Post date:** [April 5, 2021, 1:30pm UTC](https://community.sendbird.com/t/user-s-online-presence/2012/1 "2021-04-05T13:30:00Z")

</div>

Hi,  
Correct me if i’m wrong but the only way to know if a user is online or offline is by using this code as mentioned in the doc

```auto
ArrayList<String> userIds = new ArrayList<>();
userIds.add("Jeff");

ApplicationUserListQuery listQuery = SendBird.createApplicationUserListQuery();
listQuery.setUserIdsFilter(userIds);

listQuery.next(new UserListQuery.UserListQueryResultHandler() {
    @Override
    public void onResult(List<User> list, SendBirdException e) {
        if (e != null) { 
            // Handle error.
        }

        // list.get(0) = 'Jeff' 
        if (list.get(0).getConnectionStatus() == User.ConnectionStatus.ONLINE) {
            // 'Jeff' is currently online.
            // User.ConnectionStatus consists of NON_AVAILABLE, ONLINE, and OFFLINE.
            ... 
        }
    }
});

```

and if i need a more realtime approach then i need to follow this as mentioned in the doc

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/3/37b12246981016f329af41d7dba20b1e92defbf9.png)

it says that i need to have a mechanism wherein i’d be calling the `next()` function periodically, perhaps in intervals of one minute or more.

My question is how can i achieve the realtime-ness if i’ll be hitting every 1 minute or so, a user can switch back and forth from the app multiple times in a span of a minute and i won’t be notified of those events.

---

<div class="post-metadata">

**Author:** ![Cjeon](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cjeon/32/222_2.png) [@Cjeon](https://community.sendbird.com/u/Cjeon)\
**Post date:** [April 6, 2021, 10:40am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/2 "2021-04-06T10:40:40Z")

</div>

Hi @iamarjun. Could you please further explain what you are trying to do using this feature? If we knew that I believe we can deliver more helpful answers. Thank you.

---

<div class="post-metadata">

**Author:** ![iamarjun](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/iamarjun/32/1136_2.png) [@iamarjun](https://community.sendbird.com/u/iamarjun)\
**Post date:** [April 8, 2021, 8:39am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/3 "2021-04-08T08:39:41Z")

</div>

@Cjeon I want to know the other party’s online presence in real-time

---

<div class="post-metadata">

**Author:** ![Cjeon](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cjeon/32/222_2.png) [@Cjeon](https://community.sendbird.com/u/Cjeon)\
**Post date:** [April 12, 2021, 6:50am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/4 "2021-04-12T06:50:08Z")

</div>

@iamarjun sorry if it sounds repeating, but my question was that, what are you trying to do using an online presence? Are you building a friend list with online status or are you making a game that some real-time online-ness is critical? Our answer could depend on your final goal so I wanted to clarify this.

---

<div class="post-metadata">

**Author:** ![iamarjun](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/iamarjun/32/1136_2.png) [@iamarjun](https://community.sendbird.com/u/iamarjun)\
**Post date:** [April 19, 2021, 6:11am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/5 "2021-04-19T06:11:51Z")

</div>

@Cjeon It’s a simple chat app that shows a green indicator if the user is online and a grey indicator if the user is offline

---

<div class="post-metadata">

**Author:** ![Cjeon](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cjeon/32/222_2.png) [@Cjeon](https://community.sendbird.com/u/Cjeon)\
**Post date:** [April 20, 2021, 6:23am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/6 "2021-04-20T06:23:47Z")

</div>

Thanks for your reply @iamarjun . In that case, it would be pseudo-real-time, but how about checking the user’s online presence every 15 seconds or so? It would be a little delayed but most of the time it would work as expected - if it’s not enough I can talk to the team for new feature consideration as we currently do not support it.

---

<div class="post-metadata">

**Author:** ![iamarjun](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/iamarjun/32/1136_2.png) [@iamarjun](https://community.sendbird.com/u/iamarjun)\
**Post date:** [April 22, 2021, 5:16am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/7 "2021-04-22T05:16:33Z")

</div>

@Cjeon what if I check every second or so, will there be any impact?

---

<div class="post-metadata">

**Author:** ![iamarjun](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/iamarjun/32/1136_2.png) [@iamarjun](https://community.sendbird.com/u/iamarjun)\
**Post date:** [April 22, 2021, 5:42am UTC](https://community.sendbird.com/t/user-s-online-presence/2012/8 "2021-04-22T05:42:15Z")

</div>

@Cjeon what if i hi it every second, will there be any impact?

---

<div class="post-metadata">

**Author:** ![Cjeon](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cjeon/32/222_2.png) [@Cjeon](https://community.sendbird.com/u/Cjeon)\
**Post date:** [April 22, 2021, 12:27pm UTC](https://community.sendbird.com/t/user-s-online-presence/2012/9 "2021-04-22T12:27:16Z")

</div>

@iamarjun Requesting every second would not exceed rate limits (see [link](https://sendbird.com/docs/chat/v3/platform-api/guides/rate-limits#2-plan-based-limits) for details). Requesting every second would make sense 🤗.
