getDeviceNumWithDpCode(params: Object)

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

const { getDeviceNumWithDpCode } = device;

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

Description

Get the count of devices in the group that have the specified dpCode. If it is a shared group, obtain it via the API.

Parameters

PropertyTypeRequiredDescription
groupIdstringYesgroupId Group ID
dpCodestringYesdpCode value
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionDeviceKit Since
groupIdstringgroupId Group IDv3.3.0
deviceNumnumberdeviceNum Device countv4.13.1
devieNumDeprecatednumberdevieNum Device count
↳ The field name appears to be misspelled; please use deviceNum
v3.3.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

device.getDeviceNumWithDpCode({
  groupId: "xx",
  dpCode: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});