Classes
The following classes are available globally.
-
The Controller manages the communication components and a call. It is a singleton. All configuration and interaction are initialized through the Controller.
// Specify the settings for the service Controller.shared.service.address = <cloud server address> Controller.shared.service.tenantID = <your tenant ID> Controller.shared.service.clientID = <your application client ID> Controller.shared.service.language = <your locale> // Specify a mandatory value to lookup variable to match against an engagement scenario Controller.shared.contextAttributes.setValue( "Basic Guidance", forKey: "appLocation") // Specify optional information about the customer Controller.shared.contextAttributes.setValue("Macy Williams", forKey: "fullName") Controller.shared.contextAttributes.setValue("macy.williams@example.com", forKey: "email") Controller.shared.contextAttributes.setValue("+16505550121", forKey: "phone")
To display the call component, modify the “viewDidLoad” method of the UIViewControllers where you want the call components to show
See moreoverride func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) Controller.shared.addComponent(viewController: self) }
Declaration
Swift
@objc public final class Controller : NSObject