Skip to main content
SDKsiOS

Configuration

MotiSig.initialize parameters, environment variables, and defaults for the iOS SDK.

MotiSig.initialize

Call once at app launch:

MotiSig.initialize(
    sdkKey: "your-sdk-key",
    projectId: "your-project-id",
    baseURL: nil,                      // optional; see default below
    logLevel: .error,                 // .none, .error, .info, .debug
    pingIntervalSeconds: 60,          // foreground heartbeat (clamped 1…86400)
    skipPermissionRequest: false,     // when true, no system permission prompt
    skipNotificationListeners: false  // when true, no UNUserNotificationCenter proxy
)
ParameterDescription
sdkKeyProject API key. Sent as HTTP header X-API-Key. If empty after trimming whitespace, the SDK reads MOTISIG_SDK_KEY from ProcessInfo.processInfo.environment.
projectIdProject identifier. Sent as X-Project-ID. If empty, reads MOTISIG_PROJECT_ID.
baseURLAPI base URL (typically ending in /client). If nil, reads MOTISIG_BASE_URL from the environment; if unset or invalid, the SDK uses the built-in default (see below).
logLevelMinimum level for SDK logging (LogLevel).
pingIntervalSecondsForeground heartbeat interval in seconds (default 60; invalid or non-positive values use 60, max 86400).
skipPermissionRequestWhen true, does not show the system notification permission prompt; still registers for remote notifications (Expo parity).
skipNotificationListenersWhen true, does not install the UNUserNotificationCenter delegate proxy (no MotiSig notification callbacks or automatic click tracking from pushes).

If sdkKey or projectId resolves to empty, initialization logs an error and returns false without configuring the HTTP client. Subsequent calls return true immediately if already initialized.

Default base URL

When no valid baseURL or MOTISIG_BASE_URL is provided, the SDK uses:

https://api.motisig.ai/client

(Defined as Configuration.defaultBaseURL in the package.)

Environment variables (CI and schemes)

You can rely entirely on the process environment:

VariableMaps to
MOTISIG_SDK_KEYsdkKey
MOTISIG_PROJECT_IDprojectId
MOTISIG_BASE_URLbaseURL

In Xcode, set these on your test scheme or run configuration for local and integration testing. Never commit real keys to the repository.

Runtime state

  • MotiSig.shared.isInitialized is true after a successful initialize.
  • MotiSig.shared.currentUserId reflects the persisted user id after a successful setUser.