Prerequisites
- A working React Native quickstart
- Cloud Filters enabled for the project
Request the catalog
const page = await NosmaiCameraSdk.getCloudFilters({
packageType: 'effect',
page: 1,
limit: 20,
});
Use the typed object returned by the SDK. Do not rebuild the item from display text.
Download and apply
const selected = page.filters[0]; const download = await NosmaiCameraSdk.downloadCloudFilter(selected); await NosmaiCameraSdk.applyEffect(download.path);
To remove the active package, pass the same path to removeEffect. Keep one Promise per cloud identifier so repeated taps share the operation.
Handle cache eviction
Treat the downloaded URI as session/cache state, not a permanent application asset. The cache has no documented cross-platform TTL and the operating system can reclaim it. Re-query the SDK state when the item is selected and download again if the local package is missing. Keep the cloud item identifier as the durable reference.
Verify it worked
Reopen the camera screen and use the SDK's catalog or cache state rather than a stored temporary path.
Common errors
| Error or symptom | Fix |
|---|---|
E_INVALID_PACKAGE_PATH | Apply the downloader's returned path unchanged |
| Stale item updates a closed sheet | Ignore results after the component unmounts |
| Duplicate network work | Reuse the in-flight Promise keyed by cloud identifier |