Is Chat available?

Returns the current chat availability for an organization.

If your organization has Business Schedules or Holidays enabled, the Kustomer.isChatAvailable() method will return the availability based on those dates and times.

Returns KUS_ONLINE if you have chat set to appear available outside of business hours.

Kustomer.getInstance().isChatAvailable {
            val response = it.successOr(KusChatAvailability.KUS_OFFLINE)
            when(response){
                KusChatAvailability.KUS_ONLINE -> //Chat is available
                KusChatAvailability.KUS_OFFLINE -> //Chat is unavailable. outside of business hours, or a holiday
                KusChatAvailability.KUS_HIDDEN -> //Chat is unavailable. outside of business hours, or a holiday
                KusChatAvailability.KUS_DISABLED -> //Chat is turned off.
            }
        }

KusChatAvailability types -

Availability

Description

KUS_DISABLED

Chat is disabled in Chat settings. Chat will not display by default.

KUS_OFFLINE

Chat is enabled in Chat settings and the current date and time are outside of business hours. You have set your chat widget to appear offline when outside of business hours.

KUS_ONLINE

Chat is enabled in Chat settings and the date and time are currently within business hours.

KUS_HIDDEN

Chat is enabled in Chat settings and the current date and time are outside of business hours. You have set your chat widget to be hidden when outside of business hours.


Did this page help you?