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
)| Parameter | Description |
|---|---|
sdkKey | Project API key. Sent as HTTP header X-API-Key. If empty after trimming whitespace, the SDK reads MOTISIG_SDK_KEY from ProcessInfo.processInfo.environment. |
projectId | Project identifier. Sent as X-Project-ID. If empty, reads MOTISIG_PROJECT_ID. |
baseURL | API 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). |
logLevel | Minimum level for SDK logging (LogLevel). |
pingIntervalSeconds | Foreground heartbeat interval in seconds (default 60; invalid or non-positive values use 60, max 86400). |
skipPermissionRequest | When true, does not show the system notification permission prompt; still registers for remote notifications (Expo parity). |
skipNotificationListeners | When 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:
| Variable | Maps to |
|---|---|
MOTISIG_SDK_KEY | sdkKey |
MOTISIG_PROJECT_ID | projectId |
MOTISIG_BASE_URL | baseURL |
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.isInitializedistrueafter a successfulinitialize.MotiSig.shared.currentUserIdreflects the persisted user id after a successfulsetUser.