Skip to main content
This page matches SDK 2.0.0. Auth: Auth & License. Enums: Parameter enums.

Integration

Engine creation returns nil

  • Confirm licenseToken or appId + appKey is set. Token wins if both are present.
  • Bind the Mac Bundle ID (CLI tools: process name).
  • Online auth needs Outgoing Connections in the App Sandbox and a path to /facebetter/v2/auth.
  • Enable logs before createEngineWithConfig: and watch events 1 / 101.
  • CocoaPods: pod 'Facebetter', '2.0.0'. Open the .xcworkspace.

Missing headers or classes

  • Import #import <Facebetter/FBBeautyEffectEngine.h>.
  • Manual .framework: Embed & Sign.
  • Xcode 15+ CocoaPods sandbox: set ENABLE_USER_SCRIPT_SANDBOXING to No.
  • Architectures: x86_64 and arm64.
  • Deployment target macOS 10.15+.

Auth

licenseToken vs appId / appKey

If licenseToken is non-empty, the SDK verifies that token / {token} JSON / .lic locally. Otherwise it uses online auth. Details: Auth & License.

Event 1 or 101

License or init failed. Check Bundle ID, sandbox network, token expiry, and logs.

Beauty

Effect is too weak or too strong

  • Skin / makeup / filter: [0.0, 1.0].
  • Reshape: [-1.0, 1.0] via setReshape:intensity:.
  • Body reshape: [0.0, 1.0] via setBodyReshape:intensity:. Register resource_body.fbd first.
  • Intensity 0 disables that effect.
  • Skin-only: setBeautySkinOnly:.
Preset names: Parameter enums.

Filters, stickers, virtual background

Pass the .fbd path or bytes. Sandboxed apps must be able to read that path.
Virtual background:

Processing

processImage: returns nil

Invalid frame, failed init, or externalContext = YES without a current GL context.

Frame type

Set imageFrame.type to FBFrameTypeImage (0) or FBFrameTypeVideo (1). No process-mode argument.

Format conversion

Use convert::

NSImage

Camera

  1. AVCaptureVideoDataOutput → CVPixelBuffer.
  2. createWithNV12:... or createWithBGRA:....
  3. type = FBFrameTypeVideo, optional setMirror:@"horizontal".
  4. Display [output data] or [output texture] in an AppKit / OpenGL view.

Performance

  • FBFrameTypeVideo for live; watch getStats.
  • One engine, serial queue.
  • Pause capture when the window is miniaturized.

Logging

Write logs inside the sandbox container. Return codes: Error Handling.

Version

  • macOS 10.15+, x86_64 + arm64.
  • CocoaPods: pod 'Facebetter', '2.0.0'.
  • Universal Binary: confirm the xcframework contains both slices (lipo -info).

Sandbox and App Store

  • Outgoing network for online auth.
  • NSCameraUsageDescription for camera.
  • Security-scoped bookmarks for user-selected files.
  • Do not use private APIs; keep the engine off the main thread for live video.