The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Business Hours for iOS

If you've set up business hours in Salesforce, use the retrieveBusinessHours method to check for business hours and handle things accordingly. For instance, you can hide the chat button outside of business hours. When using the UI SDK, customers see a banner in the chat window when it's outside of business hours.

To configure business hours for your deployment, see Set Business Hours in Messaging for In-App and Web.

This feature requires version 1.3.0 or later of the Messaging for In-App SDK.

This article applies to the following implementations:

UI SDKCore SDK

Retrieve the business hours from the core client object using the retrieveBusinessHours method, and then determine how to proceed based on that information. This method returns the business hours over the next 24 hours. You can use the helper method isWithinBusinessHours to determine whether a time is within business hours; specify nil for the comparisonTime to use the current time.

This sample requires the configuration object that you created when setting up the UI SDK or the Core SDK. See Build a UI SDK App or Build a Core SDK App for more information.