Skip to main content
SDKsiOS

Migration and cross-SDK parity

API map across iOS, Android, and Expo for MotiSig client SDKs.

This page collects the cross-SDK API map for MotiSig (iOS, Android, Expo) and the rules the iOS SDK follows for breaking changes. For SemVer specifics, see Versioning.

Public API parity

The three SDKs expose the same product surface, with platform-idiomatic naming. Use this list when you port an integration between platforms.

Lifecycle

  • iOS: MotiSig.initialize(...), MotiSig.shared.setUser(id:), MotiSig.shared.logout()
  • Android: MotiSig.initialize(context, sdkKey, projectId, baseURL, logLevel, pingIntervalSeconds), MotiSig.getInstance().setUser(id), MotiSig.getInstance().logout()
  • Expo: await motisig.initialize({ sdkKey, projectId, baseURL?, easProjectId?, ... }), await motisig.setUser(id), await motisig.logout()

User profile

  • iOS / Android: updateUser(firstName:, lastName:, email:)nil/null fields are omitted.
  • Expo: await motisig.updateUser({ firstName?, lastName?, email? }).

Tags, attributes, events

  • All three: addTags, removeTags, setAttributes (Expo: addOrUpdateAttributes), removeAttributes, ping, triggerEvent.
  • iOS: triggerEvent accepts a completion that delivers Result<String, Error> on the cooperative pool.
  • Android: triggerEvent accepts a (Result<String>) -> Unit callback that runs on the main thread.
  • Expo: triggerEvent returns a Promise<string> that resolves to the server message.

Push subscription

  • iOS: APNs token, pushType: "apns", devicePlatform: "ios".
  • Android: FCM token, pushType: "fcm", devicePlatform: "android".
  • Expo: Expo push token, pushType: "expo", devicePlatform: "ios" | "android".

permission (granted / declined / unknown) and enabled (customer flag) semantics are identical across platforms.

Notification listeners

  • iOS: addNotificationListener(_:order:) returns MotiSigNotificationSubscription (held weakly).
  • Android: addNotificationListener(listener, order?) returns MotiSigNotificationSubscription (held weakly).
  • Expo: addListener(fn) emits foreground_notification, notification_response, token_refresh.

Delivered notifications

  • iOS: MotiSig.shared.fetchDeliveredNotifications() (UNUserNotificationCenter).
  • Android: MotiSig.getInstance().fetchDeliveredNotifications { ... } (API 23+, NotificationManager.getActiveNotifications).
  • Expo: not available. Reconcile via the notification_response event when the user taps.

Click tracking

All three call POST /track/click automatically when:

  • the payload contains messageId, and
  • a user is set, and
  • the event is a tap (not a foreground delivery).

Expo also exposes motisig.trackClick(messageId, isForeground?) for manual calls.

Image payload contract

The image URL key resolution is identical across iOS, Android (example helper), and the Expo NSE:

  1. _motisig.imageUrl / _motisig.image_url / _motisig.image
  2. _richContent.image
  3. fcm_options.image
  4. Top-level image / imageUrl / image_url

A single server payload that uses _motisig.imageUrl will light up the banner image on every platform that has the right delivery setup. See Rich notification images.

Release notes for the Swift package: CHANGELOG.