Skip to main content

Initializing the SDK

The SDK initializes automatically when the application starts. No manual setup is required.

info

The SDK does not send requests, track events, or collect any data until you call enable().

Lifecycle and Idempotency

Initialization is distinct from enabling the SDK:

ActionEffect
Auto-init (all platforms)Prepares internal components. No network traffic.
initialize() (optional, iOS only)Explicit initialization. Only needed with Option C.
enable(config)Validates configuration, starts networking, processes pending events.
disable()Stops new requests. Queued data is kept.

Calling enable more than once is safe — the SDK returns an “already enabled” error that you can ignore.

Best Practices

  • Defer enable() until the user has given consent and the application code is available.
  • To attribute early events to a known user, link the contact immediately after calling enable().
  • For testing, call enable() with a test application code and verify events in SAP Engagement Cloud.