Skip to main content
SDKsAndroid

Migration and cross-SDK parity

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

This page collects the cross-SDK API map for MotiSig (Android, iOS, Expo) and how behavior lines up across platforms. For Android SemVer and wire-format rules, 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

  • Android: MotiSig.initialize(context, sdkKey, projectId, baseURL?, logLevel, pingIntervalSeconds, skipPermissionRequest?, skipNotificationListeners?) returns Boolean; MotiSig.getInstance().reset() clears local state without server logout; MotiSig.getInstance().setUser(id, register?, completion?), getUser { … }, trackClick, MotiSigAPIClient, onFcmTokenChange, logout()
  • iOS: MotiSig.initialize(...) -> Bool, MotiSig.shared.reset(), MotiSig.shared.setUser(id:register:completion:), getUser(), trackClick, MotiSigAPIClient, onApnsTokenChange, logout()
  • Expo: await motisig.initialize({ sdkKey, projectId, baseURL?, easProjectId?, ... }), await motisig.setUser(id), await motisig.logout()

User profile

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

Tags, attributes, events

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

Push subscription

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

permission (granted / declined; iOS/Expo also produce unknown) and enabled (customer flag) semantics are identical across platforms.

Notification listeners

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

Delivered notifications

  • Android: MotiSig.getInstance().fetchDeliveredNotifications { ... } (API 23+, NotificationManager.getActiveNotifications).
  • iOS: MotiSig.shared.fetchDeliveredNotifications() (UNUserNotificationCenter).
  • 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).

On Android specifically, taps are detected when you forward the launcher activity intent via MotiSig.getInstance().handleNotificationIntent(intent).

Image payload contract

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

  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 lights up the banner image on every platform that has the right delivery setup. See Rich notification images.

Release notes: CHANGELOG.