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

Error codes (FBErrorCode)

Setter APIs return int. 0 is success. createEngineWithConfig: and processImage: return objects (nil on failure).

Check return values

Map codes in one place:

Engine events

FBEngineCallbacks.onEngineEvent reports license and init asynchronously. Set callbacks immediately after creating the engine.
createEngineWithConfig: returning a non-nil instance does not replace listening for event 1 / 101. Online auth can still fail after construction.

Image processing

Validate the frame, set type, and treat a nil return as FBErrorCode_Process. macOS can handle larger stills; still reject zero-size buffers.
Save with toFile: (returns FBErrorCode):
createWithNSImage: returns nil if the NSImage has no bitmap representation.

Logging

Enable logs before creating the engine. Create the log directory if you write a file. In a sandboxed Mac app, write under the container (for example Application Support), not an arbitrary path.

macOS-specific failures

  • App Sandbox: enable outgoing network for online appId / appKey. User-selected files need security-scoped bookmarks (startAccessingSecurityScopedResource).
  • -5 I/O: the .fbd / background image is outside the sandbox or the bookmark is not started.
  • CLI tools: if there is no Bundle ID, bind the process name in the Dashboard.
  • External GL: if externalContext = YES, create and process on the same OpenGL thread.

Practical checks

  • -1 Invalid argument: empty .fbd path, nil NSData, intensity outside the documented range, or a nil config.
  • -2 Not initialized: calling setters after a failed createEngineWithConfig: (the instance is nil).
  • -3 License: wrong credentials, unbound Bundle ID, expired token, or sandbox blocking the auth request. See Auth & License.