Prerequisites
- A working React Native quickstart
- A compatible AR mask available through Cloud Filters
Obtain and apply the mask
const page = await NosmaiCameraSdk.getCloudFilters({
packageType: 'effect',
page: 1,
limit: 20,
});
const mask = page.filters[0];
if (mask) {
const download = await NosmaiCameraSdk.downloadCloudFilter(mask);
await NosmaiCameraSdk.applyEffect(download.path);
}
Remove it
await NosmaiCameraSdk.removeEffect(download.path);
Verify it worked
Test face loss, reacquisition, rotation, navigation, and Fast Refresh cleanup on both native platforms.
Common errors
| Error or symptom | Fix |
|---|---|
E_INVALID_PACKAGE_PATH | Use the successful Cloud Filter download result |
| Mask appears after screen closes | Ignore stale Promises and call cleanup during unmount |
| Selection becomes stale | Observe active effects instead of trusting the last button tap |