---
name: "getProductInfo"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "1.2.6" }
  - { name: "@ray-js/ray", version: "0.6.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getProductInfo

> [VERSION] DeviceKit >= 1.2.6 | @ray-js/ray >= 0.6.23

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get product information

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `productId` | `string` | Yes | - | `1.2.6` | Product ID |
| `productVer` | `string` | No | `"1.0.0"` | `4.3.6` | Product version |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `panelConfig` | `Record<string, Record<string, any>>` | `3.3.0` | Panel configuration options, configurable on the platform |
| `schema` | `string` | `3.3.0` | Collection of product function definitions |
| `schemaExt` | `string` | `3.3.0` | Extended collection of product function definitions |
| `capability` | `number` | `3.3.0` | capability 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. |
| `attribute` | `number` | `3.3.0` | attribute Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations. |
| `productId` | `string` | `3.3.0` | productId Product ID |
| `category` | `string` | `3.3.0` | category Product category |
| `categoryCode` | `string` | `3.3.0` | categoryCode Secondary product category |
| `standard` | `boolean` | `3.3.0` | standard Whether it is a standard product |
| `pcc` | `string` | `3.3.0` | pcc Classification identifier for Thing in-house Bluetooth mesh products |
| `vendorInfo` | `string` | `3.3.0` | vendorInfo Classification identifier for Thing in-house Bluetooth mesh products, used for fusion types |
| `quickOpDps` | `string[]` | `3.3.0` | quickOpDps DP IDs for quick actions |
| `faultDps` | `string[]` | `3.3.0` | faultDps DP IDs for alarm/error display |
| `displayDps` | `string[]` | `3.3.0` | displayDps DP IDs for quick actions |
| `displayMsgs` | `Record<string, Record<string, any>>` | `3.3.0` | displayMsgs Display text for quick actions |
| `uiPhase` | `string` | `3.3.0` | uiPhase Current environment of the UI package: preview or production |
| `uiId` | `string` | `3.3.0` | uiId Unique package name identifier for the UI package |
| `uiVersion` | `string` | `3.3.0` | uiVersion UI package version |
| `ui` | `string` | `3.3.0` | ui UI short ID |
| `rnFind` | `boolean` | `3.3.0` | rnFind Whether an RN package is included |
| `uiType` | `string` | `3.3.0` | uiType UI package type |
| `uiName` | `string` | `3.3.0` | uiName UI package name |
| `i18nTime` | `number` | `3.3.0` | i18nTime Last update time of the product language pack |
| `supportGroup` | `boolean` | `3.3.0` | supportGroup Whether creating groups is supported |
| `supportSGroup` | `boolean` | `3.3.0` | supportSGroup Whether creating standard groups is supported |
| `configMetas` | `Record<string, Record<string, any>>` | `3.3.0` | configMetas Special product configuration items; special settings for certain features |
| `productVer` | `string` | `3.3.0` | productVer Product version |
| `attributeString` | `string` | `4.0.0` | attribute formatted binary string Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations. |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Examples

#### Basic usage

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

const { getProductInfo } = device;

getProductInfo({
  productId: 'example',
  success: (result) => {
    console.log('getProductInfo success', result);
  },
  fail: (error) => {
    console.log('getProductInfo fail', error.errorMsg);
  },
});
```
