Skip to content

Latest commit

 

History

History
126 lines (110 loc) · 4.34 KB

toast.application.md

File metadata and controls

126 lines (110 loc) · 4.34 KB

toast.application

toast.application privides APIs related with the application.

Supported platforms

  • 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)
exitOOOOOOO
launchAppXOOOOOO
getRequestedAppInfoXOOOOOO

Full WebIDL

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;
    };       
};

APIs

void exit();

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.
  • Examples
    1. 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.
  • Examples
    1. 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.
  • Examples
    1. 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);
      });

See others

toast.inputdevice