Application

@objc open class Application: Channel

An Application represents an application on the TV device. Use this class to control various aspects of the application such as launching the app or getting information

  • id

    The id of the channel

    Declaration

    Swift

    open fileprivate(set) var id: String? = nil
  • start arguments

    Declaration

    Swift

    open fileprivate(set) var args: [String:AnyObject]? = nil
  • Bundle Indentifier

    Declaration

    Swift

    open static let BUNDLE_IDENTIFIER = "com.samsung.sta.multiscreen.MSF"
  • property value library

    Declaration

    Swift

    open static let PROPERTY_VALUE_LIBRARY = "IOS SDK";
  • Retrieves information about the Application on the TV

    Declaration

    Swift

    open func getInfo(_ completionHandler: @escaping (_ info: [String:AnyObject]?, _ error: NSError?) -> Void)

    Parameters

    completionHandler

    The callback handler with the status dictionary and an error if any

  • Launches the application on the remote device, if the application is already running it returns success = true. If the startOnConnect is set to false this method needs to be called in order to start the application

    Declaration

    Swift

    open func start(_ completionHandler: ((_ success: Bool, _ error: NSError?) -> Void)?)

    Parameters

    completionHandler

    The callback handler

  • Stops the application on the TV

    Declaration

    Swift

    open func stop(_ completionHandler: ((_ success: Bool, _ error: NSError?) -> Void)?)

    Parameters

    completionHandler

    The callback handler

  • Starts the application install on the TV, this method will fail for cloud applications

    Declaration

    Swift

    open func install(_ completionHandler: ((_ success: Bool, _ error: NSError?) -> Void)?)

    Parameters

    completionHandler

    The callback handler

  • override channel connect. connects your client with the host TV app - parameter attributes: Any attributes you want to associate with the client (ie. [name:FooBar]) - parameter completionHandler: The callback handler

    Declaration

    Swift

    open override func connect(_ attributes: [String : String]?, completionHandler: ((_ client: ChannelClient?, _ error: NSError?) -> Void)?)

    Parameters

    attributes

    Any attributes you want to associate with the client (ie. [“name”:“FooBar”])

    completionHandler

    The callback handler

  • Disconnects your client with the host TV app

    Declaration

    Swift

    open func disconnect(leaveHostRunning: Bool, completionHandler: ((_ client: ChannelClient?, _ error: NSError?) -> Void)?)

    Parameters

    leaveHostRunning

    True leaves the TV app running ,False stops the TV app if yours is the last client

    completionHandler

    The callback handler

  • Disconnect from the channel and leave the host application running if leaveHostRunning is set to true and you are the last client

    Declaration

    Swift

    open func disconnect(leaveHostRunning: Bool)

    Parameters

    leaveHostRunning

    True leaves the TV app running False stops the TV app if yours is the last client

  • Disconnect from the channel and terminate the host application if you are the last client

    Declaration

    Swift

    open override func disconnect(_ completionHandler: ((_ client: ChannelClient?, _ error: NSError?) -> Void)?)

    Parameters

    completionHandler

    The callback handler