fitStartAddUnlockMethod(params: FitStartAddUnlockMethodParams)

Requires:
@ray-js/lock-sdk≥1.2.0

Description

Start a multi-stage process on the accessory side to add an unlock method (fingerprint/card/face, etc.)

Parameters

ParameterTypeRequiredDescription
YesLaunch parameters

Return Value

Type: Promise<FitStartAddUnlockMethodResult>
{ total }: total number of steps; subsequent steps are pushed via onFitAddUnlockMethod
FitStartAddUnlockMethodResult
PropertyTypeDescription
totalnumberTotal number of steps (returned by the device)

Error Code

Error CodeError Message
1014This unlock method type is not supported
1001Device is offline
1088Accessory is not bound to a lock
1089Target lock not found
1002Operation timed out
1015~1025 Device reported start failure (status 0~10)
1026Device reported start failure (status 0xfe)
1027Device reported an unknown stage

Valid Values

FitStartAddUnlockMethodParams.type
ValueDescriptionSince
finger--
face--
password--
card--
fingerVein--
hand--
eye--

Examples

import { fitStartAddUnlockMethod, onFitAddUnlockMethod } from '@ray-js/lock-sdk';
onFitAddUnlockMethod((event) => console.log(event));
const { total } = await fitStartAddUnlockMethod({
  lockDevId: 'lock_xxx',
  userId: 'user_001',
  type: 'finger',
});