Prerequisites
- A working React Native quickstart
- An active effect package that declares runtime parameters
Read the authored controls
Query the typed metadata after package application:
const parameters = await NosmaiCameraSdk.getEffectParameters();
for (const parameter of parameters) {
console.log(parameter.displayName, parameter.type, parameter.currentValue);
}
NosmaiEffectParameter includes the authored name and type, current and default values, optional numeric range, option list, display name, and description.
Update a value
Use an exact name returned for the active package:
const updated = await NosmaiCameraSdk.setEffectParameter( 'AUTHORED_PARAMETER_NAME', 0.5 ); const textUpdated = await NosmaiCameraSdk.setEffectParameterString( 'AUTHORED_TEXT_PARAMETER_NAME', 'Hello' );
The JavaScript boundary rejects empty names, non-finite numbers, control characters in names, and line breaks in string values before calling native code. Clamp numeric UI input to the authored range.
Verify the update
Read a numeric control through getEffectParameterValue and confirm the processed view changes without remounting NosmaiCameraView. Query metadata again after selecting a different package.
Common errors
| Error or symptom | Cause | Fix |
|---|---|---|
| The parameter list is empty | No compatible package is active, or it declares no controls | Apply the intended package successfully, then query again |
The update resolves false | The native package rejected the name or value type | Use the exact returned name and matching numeric or string setter |
E_INVALID_ARGUMENT | The name or value failed JavaScript validation | Pass a non-empty authored name and a finite single-line value |