If your organization has [Business Schedules or Holidays](🔗) enabled, the Boolean passed in the callback for `Kustomer.isChatAvailable()
` callback will return the following: 1) the availability based on those dates and times, and 2) the initialization state of the SDK.
This callback will return `false
` if you have chat completely turned off and the SDK has loaded settings at least once.
This callback tells you if the SDK is ready to present a chat interface. If the SDK hasn’t been initialized (that is, the SDK doesn’t have settings information loaded or cached), `Kustomer.isChatAvailable()
` will return `false
`. If you have chat set to [appear available outside of business hours](🔗), `Kustomer.isChatAvailable()
` will return `true
`.
## When `isChatAvailable
` is `nil
`
If `isChatAvailable()
` is `nil
`, this means either that 1) the local settings cache is empty or expired, or 2) that an internet connection has never been available when the SDK tried to refresh settings.
**Common scenarios for when `isChatAvailable
` is `nil
`**
Here are some common scenarios for when `isChatAvailable
` is set to `nil
`:
The user accesses chat during your set business hours
The user opens Kustomer Chat with a working internet connection
The user force quits your app
The user turns on Airplane Mode on their device
The user opens your app
`
isChatAvailable()
` is returning `true
`
Automated cache management for chat settings
The Kustomer Chat SDK automatically manages the cache for chat settings.
With this in mind, do not add calls to `
reloadChatSettings
` when your app opens, or when internet connectivity changes.The Chat SDK does reloads chat settings automatically as needed to show the chat interface.
**How to query Kustomer servers for the value of `nil
`
If `isChatAvailable()
` is `nil
`, and you need to know the value, you can use `reloadChatSettings
` to query Kustomer's servers.