Configuring the Application from Care Console

Configure the application directly from the care console now instead of making manual changes in iOS SDK by setting widgetId in your iOS SDK.

In this guide, we provide information about how to set the widgetId for your iOS SDK which will be embedded into your iOS application, and how to retrieve all the display conditions from the chat widget for your iOS SDK.
Using the widgetId, you can configure your application to show the display conditions such as the number of available agents, business hours, and so on.

Set the widgetId for your iOS SDK

To set the widgetId for your iOS SDK, you need to add the widgetId from the </> script.

To get the widgetId, you can select an existing widget or create a new widget configuration in the Care console.

Select Settings>Admin>Brand Messenger>Modern Chat.

Click on the </> Script button to get the script used in the Web iOS SDK. You will find the widgetId in that script.

Implement the below code to set the widgetId into your application for your iOS SDK.


Retrieve all the Display Conditions from the Chat Widget Configuration

Implement the below code to retrieve all the display conditions from your chat widget.

BrandMessengerManager.getAllDisplayConditions { displayConditions, error in }

Know whether all the Display Conditions are Met

Implement the below code to know whether all the display conditions are met for your chat widget.

BrandMessengerManager.isAllDisplayConditionsMet { hasDisplayConditionsMet, error in }

Turn Off the Chat Widget

If you want to make the chat widget unavailable to your customers, you can pause or turn it off directly from the care console.

Implement the below code to retrieve the pause all flags from the care console in your mobile application.

BrandMessengerManager.isWidgetHashEnabled { isWidgetHashEnabled, error in }

Additional Way to Initialize

BrandMessenger initialization can be done with a null application key and a widget id like below:

BrandMessengerManager(companyKey: "company-key", applicationKey: nil, widgetId: "widget-id", completion: { response, error in
             if error != nil {
                //do something with error
                //attempt login here

If the application key is set on the client side, it is given a preference.
Make sure the configuration URL, base url, and auth handler url are set (if not using the default) before attempting to initialize with widget id like below: