Bold360 and BoldChat Developer Center

BoldChatViewController Class Reference

A single view controller that implements the whole process of chatting with an operator through BoldChat. More...

#import <BoldChatViewController.h>

Inheritance diagram for BoldChatViewController:

Instance Methods

(id) - initWithAccountSettings:viewSettings:language:
 The constructor if initialized from code. More...
 
(void) - configureWithAccountSettings:viewSettings:language:
 Configuration that needs to be called in [UIViewController prepareForSegue:sender:] if initialized on a StoryBoard. More...
 
(void) - start
 Start the chat process. It starts with creating the chat. If the view controller is created and presented, this needs to be called. More...
 
(id< BoldChatSecureParamsProvision >) - startWithWaitingForSecureParams
 Starts the chatting with showing the loading view and waiting for secure parameters. If a secure chat is to be started, start it with calling this selector. It shows the loading view while continueWithSecureParams: is not called and the pre chat form or the chat did not arrive. More...
 
(void) - stop
 Stop and finish the chat. It can be called anytime. More...
 
(IBAction) - submitFormOrEndChat
 Depending on the view state it submits the currently shown pre, post or unavailable chat, or ends the ongoing chat. More...
 
(void) - suspend
 Suspend the chat. No need to call if handlesApplicationLifecycle is YES. More...
 
(void) - resume
 Resume the chat. No need to call if handlesApplicationLifecycle is YES. More...
 
(void) - sendMessageText:
 Send a visitor message. More...
 
(void) - sendMessageTyping:
 Send if the visitor is typing. More...
 
(IBAction) - mainExternalActionButtonPressed
 IBAction for mainExternalActionButton. More...
 
(IBAction) - endExternalActionButtonPressed
 IBAction for endExternalActionButton. More...
 
(IBAction) - errorExternalActionButtonPressed
 IBAction for errorExternalActionButton. More...
 
(void) - resignContainedFirstResponder
 Hides the keyboarded if it is presented by any of the view controller's subviews. More...
 

Properties

id< BoldChatViewControllerDelegatedelegate
 The delegate. More...
 
id< BoldChatViewControllerExternalActionsexternalEvents
 The external event callbacks. More...
 
BoldChatAccountSettingsaccountSettings
 The BoldChat account related settings for the chat. More...
 
BoldChatViewSettingsviewSettings
 The view customizations. More...
 
NSString * language
 The language of the chat. More...
 
BOOL handleKeyboardEvents
 If set the UI changes on keyboard showing/dismissal. Default: YES. More...
 
BOOL handlesApplicationLifecycle
 If YES it handles the application going background and foreground events. Default: YES. More...
 
IBOutlet UIView * loadingView
 The loading view shown as an overlay when there is an ongoing remote request. More...
 
IBOutlet UIActivityIndicatorView * loadingActivityIndicator
 The loading activity indicator view. More...
 
IBOutlet UIView * errorView
 The error view shown if there is an error. More...
 
IBOutlet UILabel * errorLabel
 The error text label. More...
 
IBOutlet UIView * endView
 The end view shown when the chat session ended. More...
 
IBOutlet UILabel * endLabel
 The end text label. More...
 
IBOutlet UIView * chatHolderView
 The view that holds the chat view. More...
 
IBOutlet UIView * preChatHolderView
 The view that holds the pre chat form. More...
 
IBOutlet UIView * postChatHolderView
 The view that holds the post chat form. More...
 
IBOutlet UIView * unavailableChatHolderView
 The view that holds the unavailable chat form. More...
 
UIButton * mainExternalActionButton
 The mainExternalAction button. More...
 
UIButton * endExternalActionButton
 The endExternalAction button that can be added ti the end view. More...
 
UIButton * errorExternalActionButton
 The errorExternalAction button that can be added ti the error view. More...
 

Detailed Description

A single view controller that implements the whole process of chatting with an operator through BoldChat.

This is a view controller that guides through the chatting process. It can be created from code with BoldChatViewController::initWithAccountSettings:viewSettings:language: .

It can also be added to a storyboard, but the BoldChatViewController::configureWithAccountSettings:viewSettings:language: needs to be called on the segue that initializes it.

When initialized it has an accountSettings and a viewSettings parameter. The accountSettings need to be filled at least with a valid BCAccount. The viewSettings contains the user interface customizations.

If (BoldChatViewSettings.formSubmitStyle == BoldChatViewSettingsFormSubmitStyleLastCell && BoldChatViewSettings.endChatStyle == BoldChatViewSettingsEndChatStyleOnChatView) there is no need to have a navigation controller around it. If no, a navigation controller needs contain it it to be able to use the right and left navigation button.

Since
Version 1.0

Method Documentation

- (void) configureWithAccountSettings: (BoldChatAccountSettings *)  accountSettings
viewSettings: (BoldChatViewSettings *)  viewSettings
language: (NSString *)  language 

Configuration that needs to be called in [UIViewController prepareForSegue:sender:] if initialized on a StoryBoard.

Parameters
accountSettingsThe account settings.
viewSettingsThe view settings.
languageThe language.
Since
Version 1.0
- (IBAction) endExternalActionButtonPressed

IBAction for endExternalActionButton.

If called, boldChatViewControllerEndExternalActionPressed: is called on the externalEvents .

Since
Version 1.0
- (IBAction) errorExternalActionButtonPressed

IBAction for errorExternalActionButton.

If called, boldChatViewControllerErrorExternalActionPressed: is called on the externalEvents .

Since
Version 1.0
- (id) initWithAccountSettings: (BoldChatAccountSettings *)  accountSettings
viewSettings: (BoldChatViewSettings *)  viewSettings
language: (NSString *)  language 

The constructor if initialized from code.

Parameters
accountSettingsThe accountSettings.
viewSettingsThe view settings.
languageThe language.
Returns
An instance of BoldChatViewController.
Since
Version 1.0
- (IBAction) mainExternalActionButtonPressed

IBAction for mainExternalActionButton.

If called, boldChatViewControllerMainExternalActionPressed: is called on the externalEvents .

Since
Version 1.0
- (void) resignContainedFirstResponder

Hides the keyboarded if it is presented by any of the view controller's subviews.

Since
Version 1.0
- (void) resume

Resume the chat. No need to call if handlesApplicationLifecycle is YES.

Since
Version 1.0
- (void) sendMessageText: (NSString *)  message

Send a visitor message.

Since
Version 1.0
- (void) sendMessageTyping: (BOOL)  typing

Send if the visitor is typing.

Since
Version 1.0
- (void) start

Start the chat process. It starts with creating the chat. If the view controller is created and presented, this needs to be called.

Since
Version 1.0
- (id<BoldChatSecureParamsProvision>) startWithWaitingForSecureParams

Starts the chatting with showing the loading view and waiting for secure parameters. If a secure chat is to be started, start it with calling this selector. It shows the loading view while continueWithSecureParams: is not called and the pre chat form or the chat did not arrive.

Returns
A class implementing BoldChatSecureParamsProvider protocol. It is for providing the secure parameters and continuing creating the chat session.
Since
Version 1.1
- (void) stop

Stop and finish the chat. It can be called anytime.

Since
Version 1.0
- (IBAction) submitFormOrEndChat

Depending on the view state it submits the currently shown pre, post or unavailable chat, or ends the ongoing chat.

Since
Version 1.1
- (void) suspend

Suspend the chat. No need to call if handlesApplicationLifecycle is YES.

Since
Version 1.0

Property Documentation

- (BoldChatAccountSettings*) accountSettings
readnonatomicassign

The BoldChat account related settings for the chat.

Since
Version 1.0
- (IBOutlet UIView*) chatHolderView
readwritenonatomicstrong

The view that holds the chat view.

Since
Version 1.0
- (id<BoldChatViewControllerDelegate>) delegate
readwritenonatomicassign

The delegate.

Since
Version 1.0
- (UIButton*) endExternalActionButton
readwritenonatomicstrong

The endExternalAction button that can be added ti the end view.

If pressed the endExternalActionButtonPressed needs to be called that calls the boldChatViewControllerEndExternalActionPressed on the externalEvents .

Since
Version 1.0
- (IBOutlet UILabel*) endLabel
readwritenonatomicstrong

The end text label.

Since
Version 1.0
- (IBOutlet UIView*) endView
readwritenonatomicstrong

The end view shown when the chat session ended.

Since
Version 1.0
- (UIButton*) errorExternalActionButton
readwritenonatomicstrong

The errorExternalAction button that can be added ti the error view.

if pressed the errorExternalActionButtonPressed needs to be called that calls the boldChatViewControllerErrorExternalActionPressed on the externalEvents .

Since
Version 1.0
- (IBOutlet UILabel*) errorLabel
readwritenonatomicstrong

The error text label.

Since
Version 1.0
- (IBOutlet UIView*) errorView
readwritenonatomicstrong

The error view shown if there is an error.

Since
Version 1.0
- (id<BoldChatViewControllerExternalActions>) externalEvents
readwritenonatomicassign

The external event callbacks.

Since
Version 1.0
- (BOOL) handleKeyboardEvents
readwritenonatomicassign

If set the UI changes on keyboard showing/dismissal. Default: YES.

Since
Version 1.0
- (BOOL) handlesApplicationLifecycle
readwritenonatomicassign

If YES it handles the application going background and foreground events. Default: YES.

Since
Version 1.0
- (NSString*) language
readnonatomicassign

The language of the chat.

Since
Version 1.0
- (IBOutlet UIActivityIndicatorView*) loadingActivityIndicator
readwritenonatomicstrong

The loading activity indicator view.

Since
Version 1.0
- (IBOutlet UIView*) loadingView
readwritenonatomicstrong

The loading view shown as an overlay when there is an ongoing remote request.

Since
Version 1.0
- (UIButton*) mainExternalActionButton
readwritenonatomicstrong

The mainExternalAction button.

If pressed the mainExternalActionButtonPressed needs to be called that calls the boldChatViewControllerMainExternalActionPressed on the externalEvents .

Since
Version 1.0
- (IBOutlet UIView*) postChatHolderView
readwritenonatomicstrong

The view that holds the post chat form.

Since
Version 1.0
- (IBOutlet UIView*) preChatHolderView
readwritenonatomicstrong

The view that holds the pre chat form.

Since
Version 1.0
- (IBOutlet UIView*) unavailableChatHolderView
readwritenonatomicstrong

The view that holds the unavailable chat form.

Since
Version 1.0
- (BoldChatViewSettings*) viewSettings
readnonatomicassign

The view customizations.

Since
Version 1.0

The documentation for this class was generated from the following file: