Skip to content

License & Auth

The SDK supports two license modes. Pick one when creating the engine:

ModeConfig fieldsWhen to use
OnlineappId + appKeyDevice can reach the network
OfflinelicenseJsonOffline / weak network / private networks

Priority: If licenseJson is set, the SDK validates it locally and does not call the network. You do not need appId / appKey in that case.

TIP

Complete Subscribe first: bind your app identifiers (Bundle ID / package name, etc.) and enable a plan.

Online auth

Copy AppID / AppKey from the dashboard and pass them when creating the engine. See each platform’s Quick Start for examples.

Offline license

Download

  1. Sign in to the Dashboard
  2. Select a project, then on the AppID & AppKey card click Download for Offline License
  3. You get: facebetter-offline-license.json

Validity follows the subscription expires_at. After renewing or changing the plan, download again.

Integrate

Pass the entire JSON file contents as a string to licenseJson. All platforms share the same C++ validation path.

iOS / macOS

objc
FBEngineConfig *config = [[FBEngineConfig alloc] init];
config.licenseJson = @"/* full file contents */";
self.beautyEffectEngine = [FBBeautyEffectEngine createEngineWithConfig:config];

Android

java
BeautyEffectEngine.EngineConfig config = new BeautyEffectEngine.EngineConfig();
config.licenseJson = "/* full file contents */";
mBeautyEngine = new BeautyEffectEngine(this, config);

Web

js
const config = new EngineConfig({
  licenseJson: '/* full file contents */',
});

Flutter

dart
await FBBeautyEffectEngine.init(
  FBEngineConfig(licenseJson: '/* full file contents */'),
);

You can also ship the JSON as an app asset and load it at runtime instead of embedding it in source.

Behavior

  • Signature, platform list, and platform_identifiers (package name, etc.) match online auth; a mismatch fails validation.
  • Not expired: features follow the plan in the license.
  • Expired: validation still succeeds, but the plan is downgraded to free. Renew and re-download.
  • Use an SDK build that supports offline licenses (expires_at in the signed payload).