Bold360 and BoldChat Developer Center

Submitting a Pre-Chat Form

For the submission of pre-chat call:

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

The results are called on the delegate:

- (void)bcChatSessionDidSubmitPreChat:(id<BCChatSession>)chatSession andDidStartChat:(id<BCChat>)chat {
    //form is submitted successfully. A chat instance is started and returned.
}
- (void)bcChatSession:(id<BCChatSession>)chatSession didSubmitPreChatToUnavailableChatWithReason:(BCUnavailableReason)reason unavailableForm:(BCForm *)unavailableForm unavailableMessage:(NSString *)message {
    //The chat is unavailable. Reason, message and unavailable form description is returned.
}
- (void)bcChatSession:(id<BCChatSession>)chatSession didFailToSubmitPreChat:(NSError *)error {
    //Submission failed.
    //Check error.code to values from BCErrorCodes.h to find out the cause of the error.
}