Machine-readable: manifest · index · English Markdown
Build an AR app with the WeChat Mini Program template
The Mini Program integration uses XR-FRAME for local tracking and 01Spatial for an absolute camera pose in map coordinates. Persistent Content remains under a map root aligned to the current trackerSpace.
Before you begin
- Enable the camera and XR capabilities required by the Mini Program.
- Configure an approved HTTPS request domain.
- Prepare a Map Key for a Ready map, or a Project Key.
- Prepare an API Key from the Portal profile.
- Confirm the map Origin and Content coordinates.
Capture one synchronized XR sample
Use one scene.ar.getARRawData() result for the image, intrinsics, viewMatrix, and camera-to-trackerSpace transform. Do not substitute a screenshot, an ordinary camera component, or an unrelated asynchronous video stream.
Copy the pixels, intrinsics, and transform before encoding. When a response arrives, confirm that the current XR session has not reset, then use the saved sample corresponding to poses[0].image.
Scene structure
trackerSpace
└── mapRoot # receives map-to-trackerSpace alignment
├── 3D models
├── navigation routes
└── annotations
Do not overwrite the XR-FRAME camera. Update mapRoot after a trusted localization result while XR-FRAME continues to provide real-time local tracking. See Localization API & AR integration for the request, confidence, and coordinate contracts.
Release checklist
- The image, intrinsics, and trackerSpace transform come from the same XR frame on a real device.
- The request domain points to the same China Portal environment that stores the map.
- Network loss, backgrounding, or an XR-session reset cancels or discards stale responses.
- API, Map, and Project keys are not stored in public code, QR parameters, or logs.
- The experience is validated on every Android and iOS WeChat version you plan to support.