To use Samsung Product API, <script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script> Should be loaded in index.html
To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
This module defines the application information retrieval functionalities provided by the Tizen Samsung Product API.
Since : 2.3
Product : TV, B2B
Defines a WebApi object instance of the Tizen Samsung Product API. The webapis.appcommon object enables access to AppCommon API functionality.
[NoInterfaceObject] interface AppCommonManagerObject { readonly attribute AppCommonManager appcommon; };
WebApi implements AppCommonManagerObject;
Provides methods for AppCommon functionalities.
[NoInterfaceObject] interface AppCommonManager { attribute AppCommonScreenSaverState AppCommonScreenSaverState; DOMString getVersion(); void setScreenSaver(AppCommonScreenSaverState state, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror); DOMString getUuid(); };
Retrieves the plugin version number.
DOMString getVersion();
Return Value :
Code Example :
try { var value = webapis.appcommon.getVersion(); console.log(" version value = " + value); } catch (error) { console.log(" error code = " + error.code); }
Sets the screensaver.
void setScreenSaver(AppCommonScreenSaverState state, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror);
Parameters :
Exceptions :
function onsuccess(data) { console.log("setScreensavervalue = " + data); } function onerror(error) { console.log("error code : " + error.code); } try { webapis.appcommon.setScreenSaver(webapis.appcommon.AppCommonScreenSaverState.SCREEN_SAVER_OFF, onsuccess, onerror); } catch (error) { console.log(" error code = " + error.code); }
Retrieves the Universally Unique Identifier (UUID). Each application generates a different UUID for the same device. The UUID must not be used for advertising purposes, and must be used complying with all applicable privacy and data protection laws and regulations, including user consent. If the application also uses the Tizen Identifier for Advertising (TIFA), the UUID must be transferred on the network using a separate stream from the TIFA. The UUID and TIFA must be handled separately from each other within your server during all data processing, storage, use, and deletion.
DOMString getUuid();
Product : TV
Since : 2.4
try { var value = webapis.appcommon.getUuid(); console.log(" Uuid value = " + value); } catch (e) { if(e.message.indexOf('undefined') == -1) { // Error, such as a missing privilege } else { // Undefined error // Older firmware and models do not support this method // Consider using a legacy method } }
Defines constants for screensaver states.
[NoInterfaceObject] interface AppCommonScreenSaverState { const unsigned long SCREEN_SAVER_OFF = 0; const unsigned long SCREEN_SAVER_ON = 1; };
module AppCommon { [NoInterfaceObject] interface AppCommonManagerObject { readonly attribute AppCommonManager appcommon; }; WebApi implements AppCommonManagerObject; [NoInterfaceObject] interface AppCommonManager { attribute AppCommonScreenSaverState AppCommonScreenSaverState; DOMString getVersion(); void setScreenSaver(AppCommonScreenSaverState state, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror); DOMString getUuid(); }; [NoInterfaceObject] interface AppCommonScreenSaverState { const unsigned long SCREEN_SAVER_OFF = 0; const unsigned long SCREEN_SAVER_ON = 1; }; };