Bold360 and BoldChat Developer Center

Submitting a Post-Chat Form

The post-chat form needs to be presented when the chat ended and there is a post-chat form to be displayed.

It is triggered by bcChat:didFinishWithReason:time:postChatForm: chat state callback. If the postChat is empty, there is no need to present the empty form, the chat session can be finished. For the submission of post-chat call:

id<BCCancelable> cancelable = [chatSession submitPostChat:<filled post-chat form> delegate:<delegate for the result of the submit>];

The results are called on the delegate:

- (void)bcChatSessionDidSubmitPostChat:(id<BCChatSession>)chatSession {
    //form is submitted successfully. Chat session is finished
}
- (void)bcChatSession:(id<BCChatSession>)chatSession didFailToSubmitPostChat:(NSError *)error {
    //Submission failed.
    //Check error.code to values from BCErrorCodes.h to find out the cause of the error.
}