Hide the "Leave a message" button in the Chat SDK
聊天SDK的默认行为是显示"Leave a message" option when you have no agents available (iOS screenshot below).
For some workflows this isn't the preferred behavior and so you may wish to hide this option. This article walks you through how to do that.
Android
Hide the button
The first thing you'll want to do is hide the button. To do this, add the following tostyles.xml.
<stylename="no_agents_button"parent="_no_agents_button">
<itemname="android:visibility">invisibleitem>
style>
Update strings
As you'll see from the screenshot above, the string on that page references leaving a message. Followthese instructionsto change the text of the string. Theno_agents_messageis the string that you'll update.
iOS
Hide the button
Again, the first thing you'll want to do is hide the button. Add the following to your app.
Swift:
UIButton.appearance(whenContainedInInstancesOf: [ZDCLoadingErrorView.self]).alpha = 0
Objective-C:
[UIButton appearanceWhenContainedIn:[ZDCLoadingErrorView class], nil].alpha = 0;
Update strings
As above, the label on that page mentions leaving a message. Followthese instructionsto change the text of the string. Theios.ZDCChat.noAgentsMessageis the string that you'll update.