ContinueDeviceInfo

The ContinueDeviceInfo module defines the parameters required for initiating mission continuation. For details about mission continuation, see continueMission.

System capability: SystemCapability.Ability.AbilityRuntime.Mission

Name Type Readable Writable Description
srcDeviceId string Yes Yes ID of the source device.
dstDeviceId string Yes Yes ID of the target device.
missionId number Yes Yes Mission ID.
wantParam {[key: string]: any} Yes Yes Extended parameters.

Example

import distributedMissionManager from '@ohos.distributedMissionManager';

let continueDeviceInfo = {
  srcDeviceId: '123',
  dstDeviceId: '456',
  missionId: 123,
  wantParam: {
      'key':'value'
  }
};

let continueCallback = {
    onContinueDone(result) {
        console.log('onContinueDone, result: ' + JSON.stringify(result));
    }
};

distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
  if (error.code != 0) {
      console.error('continueMission failed, cause: ' + JSON.stringify(error))
  }
  console.info('continueMission finished')
})