getDeviceOfflineFileStatus(params: Object)

Requires:
WearKit≥1.1.3@ray-js/ray≥1.7.82
Platforms:
iOSAndroid
import { wear } from '@ray-js/ray';

const { getDeviceOfflineFileStatus } = wear;

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

Description

Query current device offline file download status.

Parameters

PropertyTypeRequiredDescription
deviceIdstringNodeviceId; if empty, checks whether the current app has a recording task
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
PropertyTypeDescriptionWearKit Since
statusnumberCurrent download status 0: Not started 1: Downloading 2: Completed-
sessionIdnumberCurrent task ID, used to uniquely identify a single task 0 indicates the task has not started-
Download status of the current resource-
errorCodenumberError codes during download 10096: The current Wi-Fi hotspot connection has been disconnected. Please restart file upload. | Confirm button [AP hotspot network was switched] 10095: Abnormal transfer rate. Please keep the device close to the phone. [Transfer speed is 0 for 10s continuously] 10094: Please enable Wi-Fi before using Quick Transfer. [Wi-Fi permission not enabled]v1.6.12
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Error Code

Error CodeError Message
10001Internal error
10061Device error
10083Device offline

Examples

Basic usage

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

wear.getDeviceOfflineFileStatus({
  deviceId: 'deviceId',
  success: (data) => {
    console.log('getDeviceOfflineFileStatus success', data);
  },
  fail: error => {
    console.error(error);
  },
});