'Twilio conversations get online users
I am using twilio conversations for chat. I did not find any information on this in the documentation.
My questions are:
- Can I get information about whether the users of the conversation are offline or online? If yes, then how to.
- Should I manually send the user online status in order for it to be available for other members of the conversation?
This https://stackoverflow.com/a/69429640/19023823 answer did not help me as it shows how to get the online status of the current users. I need to get the online status of the other members of the conversation.
Thanks.
Solution 1:[1]
PM for Conversations here. You need to enable reachability on the Service first, then online status will be automatically tracked for SDK users. This info is retrievable via REST API and also exists on a User object via the SDK (and is evented when the status changes).
Once you turn this on, it will be automatically updated for all users of the SDK. You can look at the Participants in a Conversation with await Conversation.getParticipants()
and then check their User object's online status with Participant.getUser().isOnline
. Alternatively, you can get timely updates about changes to any user's online status by listening for userUpdated
events on the client object.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | philnash |