harmony 鸿蒙MissionParameter

  • 2022-12-22
  • 浏览 (554)

MissionParameter

The MissionParameter module defines the parameters required for mission synchronization. It can be used an input parameter in startSyncRemoteMissions.

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

System capability: SystemCapability.Ability.AbilityRuntime.Mission

Name Type Readable Writable Description
deviceId string Yes Yes Device ID.
fixConflict boolean Yes Yes Whether a version conflict occurs.
tag number Yes Yes Tag of the mission.

Example

import distributedMissionManager from '@ohos.distributedMissionManager';

try {
    distributedMissionManager.startSyncRemoteMissions(
        {
            deviceId: '123456',
            fixConflict: true,
            tag: 123
        },
        (error, data) => {
            if (error && error.code !== 0) {
                console.error(`startSyncRemoteMissions fail, error: ${JSON.stringify(error)}`);
            } else {
                console.log(`startSyncRemoteMissions success, data: ${JSON.stringify(data)}`);
            }
        }
    );
} catch (err) {
    console.error(`startSyncRemoteMissions fail: ${JSON.stringify(err)}`);
}

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

0  赞