toast.application privides APIs related with the application.
- Browser
- sectv-orsay (sectv-orsay)
- sectv-tizen (sectv-tizen)
- tv-webos (tv-webos)
Method Name | Browser | Legacy Samsung Smart TV | Tizen Samsung Smart TV | WebOS LG Smart TV | |||
Emulator (ver 5.1) | Device ('12 - '14) | Emulator (ver 2.3.1) | Device ('15 - '16) | Emulator (ver 3.0.0) | Device ('14 - '16) | ||
exit | O | O | O | O | O | O | O |
launchApp | X | O | O | O | O | O | O |
getRequestedAppInfo | X | O | O | O | O | O | O |
module Application {
[NoInterfaceObject] interface ApplicationManagerObject {
readonly attribute ApplicationManager application;
};
Toast implements ApplicationManagerObject;
[NoInterfaceObject] interface ApplicationManager {
void exit();
void launchApp(AppInfo appInfo, SuccessCallback successCallback, optional ErrorCallback? errorCallback) raises (Error);
void getRequestedAppInfo(RequestedAppInfoCallback successCallback, optional ErrorCallback? errorCallback) raises (Error);
[Callback = FunctionOnly, NoInterfaceObject] interface RequestedAppInfoCallback {
void onsuccess(RequestedAppInfo reqAppInfo);
};
dictionary AppInfo {
DomString appId;
Object? data;
};
dictionary RequestedAppInfo {
readonly DomString CallerAppId;
readonly Object? data;
};
};
This function terminates current application.
- Parameters N/A
- Return value N/A
- Exceptions
- throws TypeError
- If given arguments are not matched with API specification.
- throws Error
- if any error occured during the operation.
- throws TypeError
- Examples
-
Terminate current application when Return key pressed.
window.addEventListener('keydown', function (e) { if(e.keyCode === tvKeyCode.Return) { toast.application.exit(); } });
-
void launchApp(AppInfo appInfo, SuccessCallback successCallback, optional ErrorCallback? errorCallback);
Launches an application with application details.
- Parameters
- appInfo: The data structure describing application details.
- successCallback: The method to call when the source is changed successfully.
- errorCallback: The method to invoke when an error occurs.
- Return value N/A
- Exceptions
- throws TypeError
- If given arguments are not matched with API specification.
- throws Error
- if any error occured during the operation.
- throws TypeError
- Examples
-
Callee(appId) will be lauched with data.
toast.application.launchApp({appId: 'xxxxxxx', data: {url: 'http://...', info: 'This is video url.'}}, function() { console.log('success'); }, function(err) { console.log('fail' + err.message); });
-
void getRequestedAppInfo(ReqAppInfoCallback successCallback, optional ErrorCallback? errorCallback);
This interface has an application information requested and passed from another application and is passed to launch other applications.
- Parameters
- successCallback: The method to call when the source is changed successfully.
- errorCallback: The method to invoke when an error occurs.
- Return value N/A
- Exceptions
- throws TypeError
- If given arguments are not matched with API specification.
- throws Error
- if any error occured during the operation.
- throws TypeError
- Examples
-
Callee received the Data from caller.
toast.application.getRequestedAppInfo(function(reqAppInfo) { console.log('success' + reqAppInfo.callerAppId + ' ' + JSON.stringify(reqAppInfo.data)); }, function(err) { console.log('fail' + err.message); });
-