ChatViewController
A ChatViewController
instance represents a view controller that handles chat interaction for the EngagementSDK
.
Once an instance of ChatViewController
has been created, a ContentSession
object needs to be set to link the ChatController
with the program/CMS. The ‘ContentSession’ can be changed at any time.
The ChatViewController
can be presented as-is or placed inside a UIView
as a child UIViewController. See Apple Documentation for more information.
If the ChatViewController
is placed inside another view, please take note of the minimum size restrictions. This restriction can be ignored by setting ignoreSizeRestrictions
.
Also, an extension was included for convenience to help add a view controller inside of a specificied view. Please see UIViewController.addChild(viewController:view:)
for more information
-
The current Chat Session being displayed if any
-
Removes the current chat session if there is one set.
-
Sets the chat session to be displayed. Replaces the current chat session if there is one set.
-
A
ContentSession
used by the ChatController to link with the program on the CMS. -
The direction the view should animate in.
By default the view will animate down in portrait and to the right in landscape. Setting this value will override the defaults.
-
Use the keyboardDidHideCompletion handler to perform any tasks after the chat keyboard has been hidden
-
Use the keyboardDidHideCompletion handler to perform any tasks after the chat keyboard has been shown
-
Callback for when the user has sent a chat message.
-
Determines whether the user’s profile status bar, above the chat input field, is visible
-
The formatter used print timestamp labels on the chat message. Set to nil to hide the timestamp labels.
-
Determines whether the user is able to post images into chat
-
Show or hide the input field for chat
-
Toggles whether new message will be displayed. Messages received while
false
will catch up when set totrue
-
Determines whether the user is able to post images into chat
-
Set the
Theme
for theChatViewController
Note
A theme can be applied at any time and will update the view immediately
-
-
-
-
Forces the dismissal of the chat keyboard