1# MissionSnapshot 2 3The **MissionSnapshot** module defines the snapshot of a mission. The snapshot can be obtained through [missionManager.getMissionSnapShot](js-apis-app-ability-missionManager.md#missionmanagergetmissionsnapshot). 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8> The APIs of this module are system APIs and cannot be called by third-party applications. 9 10## Modules to Import 11 12```ts 13import missionManager from '@ohos.app.ability.missionManager'; 14``` 15 16## Attributes 17 18**System capability**: SystemCapability.Ability.AbilityRuntime.Mission 19 20| Name| Type| Readable| Writable| Description| 21| -------- | -------- | -------- | -------- | -------- | 22| ability | ElementName | Yes| Yes| Ability information of the mission.| 23| snapshot | [PixelMap](js-apis-image.md#pixelmap7) | Yes| Yes| Snapshot of the mission.| 24 25## How to Use 26 27The mission snapshot information can be obtained by using **getMissionSnapShot** in **missionManager**. 28 29**Example** 30```ts 31 import ElementName from '@ohos.bundle.bundleManager'; 32 import image from '@ohos.multimedia.image'; 33 import missionManager from '@ohos.app.ability.missionManager'; 34 35 try { 36 missionManager.getMissionInfos('', 10, (error, missions) => { 37 if (error) { 38 console.error(`getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}`); 39 return; 40 } 41 console.log(`size = ${missions.length}`); 42 console.log(`missions = ${JSON.stringify(missions)}`); 43 let id = missions[0].missionId; 44 45 missionManager.getMissionSnapShot('', id, (err, snapshot) => { 46 if (err) { 47 console.error(`getMissionInfos failed, err.code: ${JSON.stringify(err.code)}, err.message: ${JSON.stringify(err.message)}`); 48 return; 49 } 50 51 // Carry out normal service processing. 52 console.log(`bundleName = ${snapshot.ability.bundleName}`); 53 }); 54 }); 55 } catch (paramError) { 56 console.error(`error: ${paramError.code}, ${paramError.message}`); 57 } 58``` 59