Prerequisites
- A working React Native quickstart
- Background effects enabled for the project
Enable blur
if (await NosmaiCameraSdk.isAdvancedFiltersEnabled()) {
await NosmaiCameraSdk.setBackground({
mode: 'blur',
blurStrength: 0.55,
});
}
blurStrength uses 0 through 1 in the React Native API.
Disable blur
await NosmaiCameraSdk.clearBackground();
Verify it worked
The native preview should keep the subject visible while blurring the scene behind it.
Common errors
| Symptom | Fix |
|---|---|
| Promise resolves but nothing changes | Wait for onReady and verify advanced filters are enabled |
| Preview remounts while dragging | Keep a stable NosmaiCameraView and update only the native value |
| Low frame rate in Debug | Measure a Release build on a physical device |