Prerequisites
- A working iOS quickstart
- A compatible AR mask available through Cloud Filters
Obtain the mask
Select and download a compatible AR mask through Cloud Filters.
Apply it
[[NosmaiCore shared].effects
applyEffect:maskPath
completion:^(BOOL success, NSError *error) {
if (!success) NSLog(@"Mask failed: %@", error.localizedDescription);
}];
The Cloud Filter provides face anchoring and its configured reactions. The application applies the filter without implementing separate tracking logic.
Remove it
Use the typed NosmaiFilterInfo returned by the Cloud Filter catalog:
[[NosmaiSDK sharedInstance] removeEffectInfo:maskInfo];
Verify it worked
Move the face through the center and edges of the frame, turn away briefly, then return. The Cloud Filter should recover according to its configured behaviour.
Common errors
| Symptom | Fix |
|---|---|
| Mask is absent | Use a well-lit visible face and inspect apply completion |
| Mask replaces a beauty filter | Both occupy the AR slot; apply the intended package last |
| Tracking becomes unstable at the edge | Improve lighting and keep key content inside the tested camera area |