Controller

@objc
public final class Controller : NSObject

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

 override func viewDidAppear(_ animated: Bool) {
     super.viewDidAppear(animated)
     Controller.shared.addComponent(viewController: self)
 }
  • Configuration flags for the service (hostname, etc).

    See also

    Service

    Declaration

    Swift

    @objc
    public private(set) var service: Controller.Service { get }
  • Configuration flags for calls (user name etc).

    See also

    ContextAttributes

    Declaration

    Swift

    @objc
    public private(set) var contextAttributes: Controller.ContextAttributes { get }
  • Configuration flags for the UIComponent

    See also

    Settings

    Declaration

    Swift

    @objc
    public private(set) var settings: Controller.Settings { get }
  • A reference to the Controller singleton

    Declaration

    Swift

    @objc
    public static let shared: Controller
  • Make the component update when the view controller is (re)displayed. Invoke this method from the UIViewController.viewDidAppear() method on every ViewController where the call component can be shown.

    Declaration

    Swift

    @objc
    public func addComponent(viewController: UIViewController?, forceUpdate: Bool = false, autoUpdated: Bool = false)

    Parameters

    viewController

    The view controller where the component is updated. If we pass nil for viewController , the component will be removed from its super view and then do nothing.

  • url: the absolute url string we can set the meetingURL here when it’s a meeting scenario

    Declaration

    Swift

    @objc
    public func setMeetingURL(url: String)
  • A mechanism to provide optional data about the user. For the information to be used, it must be set before the call is started.

    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")
    Controller.shared.contextAttributes.setValue( "San Francisco CA, United States", forKey: "location")
    Controller.shared.contextAttributes.setValue( "Basic Guidance", forKey: "appLocation")
    

    Note that some data, such as the OS and the device type are automatically sent with the call.

    See more

    Declaration

    Swift

    @objc
    public class ContextAttributes : NSObject
  • Maintains service data for the OracleLive Controller. The Controller singleton has an instance of this class as a member. Specify the settings directly on this member class as follows:

    Controller.shared.service.address = <cloud server address>
    Controller.shared.service.userID = <user id>
    Controller.shared.service.tenantID = <your tenant id>
    Controller.shared.service.clientID = <your application client id>
    Controller.shared.service.authToken = <authentication token>
    Controller.shared.service.language = <your locale>
    
    See more

    Declaration

    Swift

    @objc
    public class Service : NSObject
  • Maintains configuration flags for the call component. The Controller singleton has an instance of this class as a member. Specify the settings directly on this member class as follows:

    Controller.shared.settings.startVideoInFullScreen = true
    Controller.shared.settings.startCallWithLoudSpeaker = true
    
    See more

    Declaration

    Swift

    @objc
    public class Settings : NSObject