onLaunch
A callback function that is automatically called when the app has been launched.
Declaration
attribute function onLaunch;Discussion
Use the onLaunch attribute to start any required actions (for example, loading the first TVML page) when the app launches. This attribute must be set to a function that accepts an options argument; for example App.onLaunch = function (options) {}. The options argument can contain the following keys:
launchContext—Determines how the app is launched. Set tobackgroundto launch the app in the background.location—Contains the boot TVMLKit JS URL location.reloadData—The object passed in toApp.reload()when the app is relaunched.User defined keys—Any custom keys that were passed to launchOptions.