ProductInfo API

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 product information functionalities provided by the Tizen Samsung Product API.

Since : 2.3

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Summary of Interfaces and Methods

Interface Method
ProductInfoManagerObject

ProductInfoManager

DOMString getVersion();
DOMString getFirmware();
DOMString getDuid();
DOMString getModelCode();
DOMString getModel();
ProductInfoSiServerType getSmartTVServerType();
DOMString getSmartTVServerVersion();
boolean isUdPanelSupported();
boolean is8KPanelSupported();
DOMString getRealModel();
boolean isWallModel();
DOMString getLocalSet();
Any getSystemConfig(ProductInfoConfigKey key);
void setSystemConfig(ProductInfoConfigKey key, DOMString value, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror);
unsigned long addSystemConfigChangeListener(ProductInfoConfigKey key, ProductInfoConfigChangeCallback listener);
void removeSystemConfigChangeListener(unsigned long listenerId);
boolean isUHDAModel();
boolean isDisplayRotatorSupported();
DOMString getLicensedVendor();
boolean isOledPanelSupported();

ProductInfoConfigChangeCallback

void onchange(ProductInfoConfigKey key);

ProductInfoConfigKey

ProductInfoNoGlass3dSupport

ProductInfoSiServerType

1. Interfaces

1.1 ProductInfoManagerObject

Defines a WebApi object instance of the Tizen Samsung Product API.
The webapis.productinfo object enables access to ProductInfo API functionality.

[NoInterfaceObject] interface ProductInfoManagerObject {
  readonly attribute ProductInfoManager productinfo;
};
WebApi implements ProductInfoManagerObject;

Attributes

1.2 ProductInfoManager

Provides methods for ProductInfo functionalities.

[NoInterfaceObject] interface ProductInfoManager {
  attribute ProductInfoConfigKey ProductInfoConfigKey;
  attribute ProductInfoNoGlass3dSupport ProductInfoNoGlass3dSupport;
  attribute ProductInfoSiServerType ProductInfoSiServerType;

  DOMString getVersion();
  DOMString getFirmware();
  DOMString getDuid();
  DOMString getModelCode();
  DOMString getModel();
  ProductInfoSiServerType getSmartTVServerType();
  DOMString getSmartTVServerVersion();
  boolean isUdPanelSupported();
  boolean is8KPanelSupported();
  DOMString getRealModel();
  boolean isWallModel();
  DOMString getLocalSet();
  Any getSystemConfig(ProductInfoConfigKey key);
  void setSystemConfig(ProductInfoConfigKey key, DOMString value, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror);
  unsigned long addSystemConfigChangeListener(ProductInfoConfigKey key, ProductInfoConfigChangeCallback listener);
  void removeSystemConfigChangeListener(unsigned long listenerId);
  boolean isUHDAModel();
  boolean isDisplayRotatorSupported();
  DOMString getLicensedVendor();
  boolean isOledPanelSupported();
};

Attributes

Methods

getVersion

Retrieves the plugin version number.

DOMString getVersion();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Plugin version

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getVersion();
  console.log(" version value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getFirmware

Retrieves the firmware information.

DOMString getFirmware();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Firmware version

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getFirmware();
  console.log(" Firmware value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getDuid

Retrieves the DUID.

DOMString getDuid();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : DUID

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getDuid();
  console.log(" Duid value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getModelCode

Retrieves the model code, such as "15_HAWKP".

DOMString getModelCode();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Model code

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getModelCode();
  console.log(" ModelCode value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getModel

Retrieves the model name, such as "UJS9500".

DOMString getModel();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Model name

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getModel();
  console.log(" Model value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getSmartTVServerType

Retrieves the infolink server type.

ProductInfoSiServerType getSmartTVServerType();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getSmartTVServerType();
  console.log(" smart tv server type = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getSmartTVServerVersion

Retrieves the infolink server version, such as "T-INFOLINK2014-1002".

DOMString getSmartTVServerVersion();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Infolink server version

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getSmartTVServerVersion();
  console.log(" smart tv server version = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

isUdPanelSupported

Checks whether UdPanel is supported.

boolean isUdPanelSupported();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • boolean : Boolean value:
    true: Supported
    false: Not supported

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.isUdPanelSupported();
  console.log(" support = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

is8KPanelSupported

Checks whether 8K panel is supported.

boolean is8KPanelSupported();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • boolean : Boolean value:
    true: Supported
    false: Not supported

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 4.0

Code Example :

try {
  var value = webapis.productinfo.is8KPanelSupported();
  console.log(" support = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getRealModel

Retrieves the full model name, such as UN65JS9500.

DOMString getRealModel();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Model name

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getRealModel();
  console.log(" ModelName value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

isWallModel

Checks whether the product model is WALL.

boolean isWallModel();

Product : TV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • boolean : Boolean value:
    true: Wall Model
    false: Not Wall Model

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 5.0

Code Example :

try {
  var value = webapis.productinfo.isWallModel();
  console.log(value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getLocalSet

Retrieves the local set.

DOMString getLocalSet();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : LocalSet value

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getLocalSet();
  console.log(" LocalSet value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

getSystemConfig

Retrieves the value for the specified system configuration key, such as service country code.

Any getSystemConfig(ProductInfoConfigKey key);

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Parameters :

  • key : Product info configuration key

Return Value :

  • Any : System configuration value. Only for CONFIG_KEY_AOT_SUPPORT key the return type is boolean, the return type for other case is DOMString.

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
    • with error type InvalidValuesError, if any of the input parameters contain an invalid value. (Since plugin version 3.0)
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.getSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_DATA_SERVICE);
  console.log("SystemConfig value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

setSystemConfig

Sets the value for the specified system configuration key.

void setSystemConfig(ProductInfoConfigKey key, DOMString value, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror);

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Parameters :

  • key : Product info configuration key
  • value : Value to set
  • onsuccess [optional][nullable] : Callback method to invoke when the system configuration key value is successfully set
  • onerror [optional][nullable] : Callback method to invoke if an error has occurred
    SecurityError, if the application does not have the privilege to call this method.

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.
      If only setSystemConfig can set CONFIG_KEY_DATA_SERVICE or CONFIG_KEY_ACTIVE_CATEGORY (Since plugin version 3.0)
    • with error type NotSupportedError, if 'CONFIG_KEY_SERVICE_COUNTRY' is readonly (Deprecated since plugin version 3.0)
    • with error type NotSupportedError, if 'CONFIG_KEY_SHOPLOGO' is readonly (Deprecated since plugin version 3.0)

Since : 2.3

Code Example :

function onsuccess(data)  {
  console.log("SystemConfig data = " + data);
}
function onerror(error)  {
  console.log("error code : " + error.code);
}
try {
  webapis.productinfo.setSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_DATA_SERVICE, value, onsuccess, onerror);
} catch (error) {
  console.log(" error code = " + error.code);
}

addSystemConfigChangeListener

Registers a system configuration change listener.

unsigned long addSystemConfigChangeListener(ProductInfoConfigKey key, ProductInfoConfigChangeCallback listener);

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Parameters :

  • key : Productinfo configuration key
  • listener : ProductInfoConfigChangeCallback listener

Return Value :

  • unsigned long : Listener ID

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
    • with error type InvalidValuesError, if any of the input parameters contain an invalid or unchangeable value. (Since plugin version 3.0)
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  var value = webapis.productinfo.addSystemConfigChangeListener(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_DATA_SERVICE, listener);
  console.log(" add Listener value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

removeSystemConfigChangeListener

Unregisters a system configuration change listener.

void removeSystemConfigChangeListener(unsigned long listenerId);

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Parameters :

  • listenerId : ProductInfoConfigChangeCallback ID

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
    • with error type InvalidValuesError, if any of the input parameters contain an invalid value. (Since plugin version 3.0)
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 2.3

Code Example :

try {
  webapis.productinfo.removeSystemConfigChangeListener(listenerId);
  console.log(" removedListener value ");
} catch (error) {
  console.log(" error code = " + error.code);
}

isUHDAModel

Checks whether the device supports Ultra HD Premium features.

boolean isUHDAModel();

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • boolean : Boolean value:
    true: Supported
    false: Not supported

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 3.0

Code Example :

try {
  var value = webapis.productinfo.isUHDAModel();
  console.log(" support = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

isDisplayRotatorSupported

This method check whether display rotator is supported or not.

boolean isDisplayRotatorSupported();

Product : TV

Privilege : N

Return Value :

  • boolean : true if display rotator is supported, else false

Since : 5.5

Code Example :

var value = webapis.productinfo.isDisplayRotatorSupported();
console.log("display rotator is supported = " + value);

getLicensedVendor

This method get an actual manufacturer's information

DOMString getLicensedVendor();

Product : TV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • DOMString : Actual manufacturer information

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 6.0

Code Example :

try {
  var value = webapis.productinfo.getLicensedVendor();
  console.log(" getLicensedVendor value = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

isOledPanelSupported

Checks whether OledPanel is supported.

boolean isOledPanelSupported();

Product : TV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Return Value :

  • boolean : Boolean value:
    true: Supported
    false: Not supported

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method.

Since : 8.0

Code Example :

try {
  var value = webapis.productinfo.isOledPanelSupported();
  console.log(" support = " + value);
} catch (error) {
  console.log(" error code = " + error.code);
}

1.3 ProductInfoConfigChangeCallback

Defines the product info configuration change callback.

[Callback = FunctionOnly, NoInterfaceObject] interface ProductInfoConfigChangeCallback {
  void onchange(ProductInfoConfigKey key);
};

Methods

onchange

Callback method for product info configuration changes.

void onchange(ProductInfoConfigKey key);

Product : TV, AV, B2B

Privilege Level : Public

Privilege : http://developer.samsung.com/privilege/productinfo

Parameters :

  • key : Key of each ProductInfo config

Since : 2.3

Code Example :

var onchange = function (key){
  console.log(" changed key is = " + key);
}

1.4 ProductInfoConfigKey

Defines constants for product info configuration keys.

[NoInterfaceObject] interface ProductInfoConfigKey {
  const unsigned long CONFIG_KEY_DATA_SERVICE = 0;
  const unsigned long CONFIG_KEY_SERVICE_COUNTRY = 1;
};

Since : 2.3

Constants

  • CONFIG_KEY_DATA_SERVICE
    Data service configuration, it can be setted as string ype with numbers
    Since : 2.3
  • CONFIG_KEY_SERVICE_COUNTRY
    Service country, readonly
    Since : 2.3

1.5 ProductInfoNoGlass3dSupport

Defines constants for glasses-free 3D support.

[NoInterfaceObject] interface ProductInfoNoGlass3dSupport {
  const unsigned long NO_GLASS_3D_NOT_SUPPORTED = 0;
  const unsigned long NO_GLASS_3D_SUPPORTED = 1;
};

Since : 2.3

Constants

  • NO_GLASS_3D_NOT_SUPPORTED
    Glasses-free 3D is not supported
    Since : 2.3
  • NO_GLASS_3D_SUPPORTED
    Glasses-free 3D is supported
    Since : 2.3

1.6 ProductInfoSiServerType

Defines constants for infolink server types.

[NoInterfaceObject] interface ProductInfoSiServerType {
  const unsigned long SI_TYPE_OPERATIING_SERVER = 0;
  const unsigned long SI_TYPE_DEVELOPMENT_SERVER = 1;
  const unsigned long SI_TYPE_DEVELOPING_SERVER = 2;
};

Since : 2.3

Constants

  • SI_TYPE_OPERATIING_SERVER
    Operating
    Since : 2.3
  • SI_TYPE_DEVELOPMENT_SERVER
    Development
    Since : 2.3
  • SI_TYPE_DEVELOPING_SERVER
    Developing
    Since : 2.3

2. Full WebIDL

module ProductInfo {
  [NoInterfaceObject] interface ProductInfoManagerObject {
    readonly attribute ProductInfoManager productinfo;
  };

  WebApi implements ProductInfoManagerObject;

  [NoInterfaceObject] interface ProductInfoManager {
    attribute ProductInfoConfigKey ProductInfoConfigKey;
    attribute ProductInfoNoGlass3dSupport ProductInfoNoGlass3dSupport;
    attribute ProductInfoSiServerType ProductInfoSiServerType;
  
    DOMString getVersion();
    DOMString getFirmware();
    DOMString getDuid();
    DOMString getModelCode();
    DOMString getModel();
    ProductInfoSiServerType getSmartTVServerType();
    DOMString getSmartTVServerVersion();
    boolean isUdPanelSupported();
    boolean is8KPanelSupported();
    DOMString getRealModel();
    boolean isWallModel();
    DOMString getLocalSet();
    Any getSystemConfig(ProductInfoConfigKey key);
    void setSystemConfig(ProductInfoConfigKey key, DOMString value, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror);
    unsigned long addSystemConfigChangeListener(ProductInfoConfigKey key, ProductInfoConfigChangeCallback listener);
    void removeSystemConfigChangeListener(unsigned long listenerId);
    boolean isUHDAModel();
    boolean isDisplayRotatorSupported();
    DOMString getLicensedVendor();
    boolean isOledPanelSupported();
  };

  [Callback = FunctionOnly, NoInterfaceObject] interface ProductInfoConfigChangeCallback {
    void onchange(ProductInfoConfigKey key);
  };

  [NoInterfaceObject] interface ProductInfoConfigKey {
    const unsigned long CONFIG_KEY_DATA_SERVICE = 0;
    const unsigned long CONFIG_KEY_SERVICE_COUNTRY = 1;
  };

  [NoInterfaceObject] interface ProductInfoNoGlass3dSupport {
    const unsigned long NO_GLASS_3D_NOT_SUPPORTED = 0;
    const unsigned long NO_GLASS_3D_SUPPORTED = 1;
  };

  [NoInterfaceObject] interface ProductInfoSiServerType {
    const unsigned long SI_TYPE_OPERATIING_SERVER = 0;
    const unsigned long SI_TYPE_DEVELOPMENT_SERVER = 1;
    const unsigned long SI_TYPE_DEVELOPING_SERVER = 2;
  };

};