Bold360 and BoldChat Developer Center

Submitting an Unavailable Chat Form

Displaying an unavailable chat can be reached from three scenarios.

  • Creating chat session returned with unavailable chat.
  • Submitting pre-chat returned with unavailable chat.
  • The chat was started and available but the agent's queue is full, and the customer explicitly canceled the chat.

Unavailable chat form is always returned in delegates when it needs to be shown. It is also contained by chatSession.unavailableChatForm property. It can be empty, in this case the chatSession can be finished, no need to display any form. If there is unavailable chat form, the answers can be submitted with the following code:

id<BCCancelable> cancelable = [chatSession submitUnavailableEmail:<filled unavailable form> delegate:<delegate for the result of the submit>];

The result are notified on the delegate:

- (void)bcChatSessionDidSubmitUnavailableEmail:(id<BCChatSession>)chatSession {
    //successful submission
}
- (void)bcChatSession:(id<BCChatSession>)chatSession didFailToSubmitUnavailableEmailWithError:(NSError *)error {
    //failed to submit
    //Check error.code to values from BCErrorCodes.h to find out the cause of the error.
}