ModeratorSDK

public class ModeratorSDK : NSObject, URLSessionWebSocketDelegate

The main high-level interface to the SDK. This is a singleton that you will obtain through the ‘shared’ property

  • Declaration

    Swift

    public var delegate: ModeratorSDKDelegate?
  • The shared instance of the ModeratorSDK

    Declaration

    Swift

    public static let shared: ModeratorSDK
  • Utility function that indicates whether or not the uuid passed in represents the local user. In this scenario, the UUID for the local is just the UUID from the JWT

    Declaration

    Swift

    public func isLocalUser(_ userUUID: String) -> Bool

    Parameters

    userUUID

    The UUID to compare against the stored channel name for this user/device

    Return Value

    true if the userUUID passed represents the local user on this device

  • Connect to the RTN service on the specified server and subscribe to a notification channel specific to this user

    Declaration

    Swift

    public func connectWebSocket(meetingUUID: String, generatedUUID: String, msgServer: String, userUUID: String, mjwt: String)

    Parameters

    generatedUUID

    The UUID generated by MeetingSDK for this user/device

    msgServer

    The name of the server hosting the RTN service

    userUUID

    The UUID of this user (taken from a JWT)

    jwt

    The encoded JWT obtained when authenticating as this user

  • Declaration

    Swift

    public func sendDeviceListUpdate()
  • Send a message to a remote user also connected to the same RTN service

    Declaration

    Swift

    public func sendMessage(_ destination: String, _ message: String)

    Parameters

    destination

    The name of the remote user’s channel

    message

    The message to send

  • Sets whether or not the user wants to allow remote users to control their PTZ cameras

    Declaration

    Swift

    public func setRemotePTZAllowed(_ value: Bool)
  • Retruns whether or not the user wants to allow remote users to control their PTZ cameras

    Declaration

    Swift

    public func getRemotePTZAllowed() -> Bool

    Return Value

    true if the user is allowing remote users to control their PTZ cameras, false if not

  • Declaration

    Swift

    public func sendPTZCommand(user: String, device: String, command: String) -> Bool

WebSocket/URLSESSION Protocols

Send/Receive methods related to websockets communications

  • Close the connection to the RTN service

    Declaration

    Swift

    public func closeSession()