Rate this page:

Reachability Indicator

Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here.

If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.

The Reachability Indicator feature of Programmable Chat provides visibility into whether a User is online or offline within the Chat Service instance context. This feature also provides the User's reachability by Push Notification within the Chat Service instance.

Reachability state is automatically updated and synchronized by the Chat service, provided the feature is enabled. The feature is enabled on a "per Service instance" basis.

Note: It is important to note that Users exist within the scope of a Chat Service instance. Thus, the Reachability indicators are also within the same scope.

Enable the Reachability Indicator

Each Service instance can have Reachability enabled or disabled. The default is disabled. Reachability state will not be updated if the feature is disabled for a given Service instance. Once enabled, the state will update and synchronize.

You must set the ReachabilityEnabled property using the Services REST resource to configure the Reachability Indicator feature.

To see if the feature is enabled for a Service instance, please refer to the reachability_enabled property of the Service REST resource representation.

Loading Code Sample...

        Enable the Reachability Indicator

        If you choose to enable Reachability Indicators and later wish to return to disabled, set the ReachabilityEnabled back to false.

        Loading Code Sample...

              Disable the Reachability Indicator

              User Reachability Properties

              The Reachability indicators are exposed for Users in two places:

              • REST API - Users resource
              • Client SDKs - User and UserDescriptor objects

              REST API

              The following read-only properties within the Users REST resource provide Reachability information for Users:

              • is_online
              • is_notifiable

              These properties are set by the Chat system if the Reachability Indicator feature is enabled for a User's Service instance.

              Note: These properties can be null under the following conditions:

              • The Reachability Indicator feature is disabled for the Service instance
              • The User has not been online since the Reachability indicator has been enabled
              • LIST GET resource representations only have a true or false value for specific GET requests

              Please see the REST Users resource documentation for more information.

              Client SDKs

              Within the Chat Client SDKs, the Reachability Indicator properties are exposed in the User and UserDescriptor objects.

              Real-time updates to other Users' Reachability Indicator states are communicated via the update event mechanism for subscribed User objects. Reachability on UserDescriptor objects is a snapshot in time. Please see the specific SDK API documentation for details, as each SDK/platform handles this update a little differently.

              An indicator of your Service instance's Reachability status (reachability_enabled ) is also exposed at the SDK client level.

              The read only client SDK properties exposed are:

              • ChatClient.reachabilityEnabled
              • User.isOnline and UserDescriptior.isOnline
              • User.isNotifiable and UserDescriptor.isNotifiable

              Note: The above are representations. The specifics of how these properties are accessed are distinct for each language/SDK.

              Note: These user properties are read only and cannot be set. Chat will update these settings and synchronize them as necessary. The Service REST resource manages the Service-level Reachability feature.

              Loading Code Sample...
                    Handle an UpdateReason change and process the Reachability Indicators

                    Process an UpdateReason

                    Handle an UpdateReason change and process the Reachability Indicators
                    Rate this page:

                    Need some help?

                    We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                    Loading Code Sample...

                          Thank you for your feedback!

                          Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                          Sending your feedback...
                          🎉 Thank you for your feedback!
                          Something went wrong. Please try again.

                          Thanks for your feedback!