getProductInfo(params: Object)

Requires:
DeviceKit≥1.2.6@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
import { device } from '@ray-js/ray';

const { getProductInfo } = device;

// Promise usage
try {
  const res = await getProductInfo({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Get product information

Parameters

PropertyTypeRequiredDefaultDescriptionDeviceKit Since
productIdstringYes-Product ID-
productVerstringNo"1.0.0"Product versionv4.3.6
complete() => voidNo-Completion callback (executed on both success and failure)-
success(params: Object) => voidNo-Callback on successful API call-
fail(params: Object) => voidNo-Failure callback-
success callback parameters
PropertyTypeDescriptionDeviceKit Since
Panel configuration options, configurable on the platformv3.3.0
schemastringCollection of product function definitionsv3.3.0
schemaExtstringExtended collection of product function definitionsv3.3.0
capabilitynumbercapability Product capability value. On the backend-ng platform you can query the corresponding selections; overall business logic is partitioned based on this data. Device types can also be adjusted based on this attribute; managed using bitwise operations.v3.3.0
attributenumberattribute Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations.v3.3.0
productIdstringproductId Product IDv3.3.0
categorystringcategory Product categoryv3.3.0
categoryCodestringcategoryCode Secondary product categoryv3.3.0
standardbooleanstandard Whether it is a standard productv3.3.0
pccstringpcc Classification identifier for Thing in-house Bluetooth mesh productsv3.3.0
vendorInfostringvendorInfo Classification identifier for Thing in-house Bluetooth mesh products, used for fusion typesv3.3.0
quickOpDpsstring[]quickOpDps DP IDs for quick actionsv3.3.0
faultDpsstring[]faultDps DP IDs for alarm/error displayv3.3.0
displayDpsstring[]displayDps DP IDs for quick actionsv3.3.0
displayMsgs Display text for quick actionsv3.3.0
uiPhasestringuiPhase Current environment of the UI package: preview or productionv3.3.0
uiIdstringuiId Unique package name identifier for the UI packagev3.3.0
uiVersionstringuiVersion UI package versionv3.3.0
uistringui UI short IDv3.3.0
rnFindbooleanrnFind Whether an RN package is includedv3.3.0
uiTypestringuiType UI package typev3.3.0
uiNamestringuiName UI package namev3.3.0
i18nTimenumberi18nTime Last update time of the product language packv3.3.0
supportGroupbooleansupportGroup Whether creating groups is supportedv3.3.0
supportSGroupbooleansupportSGroup Whether creating standard groups is supportedv3.3.0
configMetas Special product configuration items; special settings for certain featuresv3.3.0
productVerstringproductVer Product versionv3.3.0
attributeStringstringattribute formatted binary string Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations.v4.0.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { device } from '@ray-js/ray'

device.getProductInfo({
  productId: "xx",
  productVer: "1.0.0",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});