# 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

- `args`

  start arguments

  #### Declaration

  Swift

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

- `BUNDLE_IDENTIFIER`

  Bundle Indentifier

  #### Declaration

  Swift

      open static let BUNDLE_IDENTIFIER = "com.samsung.sta.multiscreen.MSF"

- `PROPERTY_VALUE_LIBRARY`

  property value library

  #### Declaration

  Swift

      open static let PROPERTY_VALUE_LIBRARY = "IOS SDK";

- `getInfo(_:)`

  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

- `start(_:)`

  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

- `stop(_:)`

  Stops the application on the TV

  #### Declaration

  Swift

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

  #### Parameters

  `completionHandler` | The callback handler

- `install(_:)`

  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

- `connect(_:completionHandler:)`

  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

- `disconnect(leaveHostRunning:completionHandler:)`

  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(leaveHostRunning:)`

  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(_:)`

  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

© 2017 . All rights reserved. (Last updated: 2017-06-08)

Generated by jazzy ♪♫ v0.7.4, a Realm project.