Prerequisites
- A working React Native quickstart
- A ready
NosmaiCameraView
Capture the processed frame
const photo = await NosmaiCameraSdk.capturePhoto(); console.log(photo.uri, photo.width, photo.height);
The result is a temporary local JPEG with uri, width, height, fileSizeBytes, and mimeType.
Save it to the gallery
const saved = await NosmaiCameraSdk.saveImageToGallery( photo.uri, 'nosmai-photo' );
Only pass a local file:// URI returned by the SDK. The method rejects remote URLs and malformed paths.
Verify it worked
Apply a visible effect, capture once, and confirm that the JPEG exists and the saved media URI is returned.
Common errors
| Symptom | Cause | Fix |
|---|---|---|
| Capture rejects before returning a URI | The native camera view is not ready | Wait for the processed preview before calling capturePhoto |
| Gallery save fails | Media-library permission is missing or denied | Request the platform permission before saving the returned file |