# iOS API reference

> Look up the public NosmaiCameraSDK 3.0.4 lifecycle, camera, effects, Cloud Filters, beauty, output, and game APIs.

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: reference
Source: https://nosmai.com/docs/effects/reference/api/ios/

## Entry points

| Type | Purpose |
| --- | --- |
| `NosmaiSDK` | Primary camera, processing, package, background, local catalog, cache, and off-screen API |
| `NosmaiCamera` | Camera attachment, capture lifecycle, switching, focus, exposure, zoom, torch, and recording |
| `NosmaiEffectsEngine` | Effects, Cloud Filters, games, beauty, makeup, runtime parameters, and pipeline state |
| `NosmaiCore` | High-level initialization, status, photo capture, recording, pause, resume, and diagnostics |

Import the umbrella header:

```objc
#import <NosmaiCameraSDK/Nosmai.h>
```

## Initialize and process

| API | Result |
| --- | --- |
| `+[NosmaiSDK initWithLicense:]` | Creates the process-wide SDK or returns `nil` when startup is rejected |
| `+[NosmaiSDK sharedInstance]` | Returns the initialized shared instance |
| `-[NosmaiSDK configureCameraWithPosition:preset:]` | Configures the internal camera before processing |
| `-[NosmaiSDK setPreviewView:]` | Attaches or detaches the preview container |
| `-[NosmaiSDK startProcessing]` | Starts camera-frame processing |
| `-[NosmaiSDK stopProcessing]` | Stops processing without destroying the instance |
| `-[NosmaiSDK cleanup]` | Releases SDK resources; create a new instance before reuse |

Use `NosmaiDelegate` to observe state, errors, detected faces, filters, external
frame completion, and license-status changes.

## Apply and clear packages

| API | Notes |
| --- | --- |
| `applyEffect:completion:` | Applies a readable local `.nosmai` package asynchronously |
| `applyEffectSync:error:` | Synchronous variant; avoid calling it on a latency-sensitive UI path |
| `setFilter:` / `clearFilter` | Controls the filter slot |
| `setAREffect:` / `clearAREffect` | Controls the AR-effect slot |
| `removeAllFilters` | Clears filter packages |
| `removeAllEffects` | Clears the complete effect pipeline |
| `getEffectParameters` | Returns parameters authored by the active package |
| `setEffectParameter:value:` | Updates a numeric parameter by its authored name |
| `setEffectParameter:stringValue:` | Updates a text parameter by its authored name |
| `getEffectParameterValue:` | Reads a numeric value; a missing value returns `NAN` |

## Local and Cloud Filters

Use `getFilters`, `getFiltersOfType:`, `getLocalFilters`, `getLocalEffects`,
`getLocalBackgrounds`, `getLocalBeautyEffects`, and `getLocalGames` for local
discovery. Cloud operations use `getCloudFiltersWithOptions:`,
`downloadCloudFilter:progress:completion:`, `isCloudFilterDownloaded:`,
`getCloudFilterLocalPath:`, and `removeCloudFilter:`.

Pass the unchanged downloaded local path to `applyEffect:completion:`. A cloud
record identifier is not a filesystem path.

## Beauty, makeup, and backgrounds

The SDK exposes skin smoothing, whitening, sharpening, teeth whitening,
brightness, contrast, RGB, hue, white balance, HSB, eye colour, makeup layers,
and signed reshape controls. Manual backgrounds use
`setBackgroundBlurEnabled:`, `setBackgroundBlurStrength:`,
`setBackgroundImage:`, `setBackgroundColor:`, `setBackgroundVideo:`, and their
matching clear methods. Check `isBeautyEffectEnabled`,
`isCloudFilterEnabled`, and `isAdvancedFiltersEnabled` before exposing gated
controls.

## Games and media

- `isGameReady`, `sendGameTapAtNormalizedX:y:`, `sendGameInput:x:y:value:`,
  `pauseGame`, `resumeGame`, and `restartGame` control an active game package.
- `capturePhoto:` returns processed image data through the high-level core.
- `startRecording` and `stopRecording` manage processed recording.
- `setCVPixelBufferCallback:` exposes processed output; use the off-screen APIs
  for an app-owned streaming pipeline.

## Threading and ownership

Perform preview and camera UI work on the main thread. Keep one active camera
owner. Serialize package mutations instead of applying and clearing from
multiple queues at once. Stop or finalize media work before cleanup.

## References

- [iOS quickstart](/docs/effects/quickstart/ios/)
- [iOS platform guide](/docs/effects/platforms/ios/)
- [iOS releases](https://github.com/nosmai/nosmai_effects_sdk_ios/releases)
