Swan SDK
Changelog

React Native

Release history for the Swan React Native SDK.

[react-native/2.10.0] — 2026-10-30

Distribution: npm — @loyalytics/swan-react-native-sdk@2.10.0 Platforms: iOS 13.4+ · Android API 23+ (compileSdkVersion 34+) · React Native 0.74+ (verified through 0.86)

Added

  • Missed pushes are recovered on Android. When Swan has turned recovery on for your push integration, a push the phone never received (for example because it was offline, or the system stopped the app in the background) is fetched when the app opens and in a periodic background check, and shown once while it is still valid. A push is never shown twice, whichever way it arrives, and nothing is fetched or shown while push is off for the app or its notifications are turned off. A recovered push shown while the app is open also reaches PUSH_NOTIFICATION_RECEIVED listeners, like any foreground push. After unsubscribePush() nothing is fetched until your app calls subscribePush(), also across app restarts; subscribePush() turns recovery back on straight away. No code changes are needed; the background check adds androidx.work:work-runtime-ktx 2.9.1 to your Android build, which needs your app's compileSdkVersion to be 34 or higher (already required by Google Play). See Recover missed pushes.
  • Delivery and tap receipts for pushes sent by the Swan platform. These pushes report their delivery and taps as receipts. Receipts are saved on the device and retried automatically if the device is offline, and the same receipt is never counted twice. Receipts need no sign-in: delivery is reported whether or not the customer is signed in. A tap on a carousel card says which card was tapped, as click reports already do.
  • Right-to-left carousels. A carousel whose text is right-to-left (for example Arabic) is laid out right to left on Android and iOS — mirrored controls and slide direction, right-aligned text — with the card order unchanged.
  • subscribePush() turns push back on after unsubscribePush(). It requests notification permission (no prompt if already granted) and, once granted, registers the device's push token with Swan. It resolves to true when notification permission is granted. unsubscribePush() and subscribePush() apply in the order your app calls them, so the last call wins even when the previous one hasn't finished. Call it from your in-app "turn notifications on" control.

Changed

  • React Native 0.74 or later is required. The Android module is built on React Native's BaseReactPackage, which React Native added in 0.74, so it does not build on React Native 0.70–0.73. This has been the case since 2.9.0; earlier release notes listed React Native 0.70 as the minimum. The device minimums are therefore React Native 0.74's: Android API 23 and iOS 13.4 (earlier release notes listed Android API 21 and iOS 13.0). The React Native 0.74 and later templates already compile against Android API 34, which the SDK's Android dependencies need.
  • A push tap's messageId is Swan's message id. NOTIFICATION_OPENED and DEEP_LINK_OPENED payloads now carry Swan's message id as messageId for every push that has one — the same value the Android and iOS SDKs report, whether the push arrived through FCM or was recovered. It used to be the FCM message id for a push delivered through FCM. The FCM message id is still in the payload as gcm.message_id. A push without a Swan message id keeps the FCM message id as messageId.
  • Silent pushes are now reported as delivered. They are still never shown and never reported as tapped.
  • Upgrading an existing app (iOS): updating the Notification Service and Content Extension files is optional. They are copied into your ios/ folder, so upgrading the package does not update them. Your current extensions keep working: deliveries and carousel card taps are still reported as before. Updating adds right-to-left carousel layout, and lets the extensions send the delivery and card-tap receipts for pushes sent by the Swan platform; until then they report those pushes as before. To update, run node node_modules/@loyalytics/swan-react-native-sdk/scripts/setup-ios-extension.js --update from your project root and rebuild — it replaces only the extensions' Swift files and keeps your Info.plist, entitlements and storyboard. The app logs a STALE iOS EXTENSION warning with this command when an out-of-date extension handles a push or a carousel tap. Package managers usually hide (npm, yarn) or skip (pnpm) a dependency's install-time output, so after each upgrade run node node_modules/@loyalytics/swan-react-native-sdk/scripts/setup-ios-extension.js --check yourself — it exits non-zero while an extension is out of date, and fits a CI step or an Xcode build phase.

Fixed

  • iOS: a push that arrives while the app is closed is now reported delivered once, not twice. The Notification Service Extension could finish before Swan had confirmed the delivery report, so the app reported the same delivery again the next time it opened. The extension now finishes once the report is confirmed, waiting at most 8 seconds; the notification is shown as before. This is in the extension files, so run node node_modules/@loyalytics/swan-react-native-sdk/scripts/setup-ios-extension.js --update after upgrading.
  • A push's custom sound, or sound none, now takes effect on Android 8 and later. On Android 8 and later a notification channel decides the sound, so a push asking for a bundled sound (res/raw/<name>) or for no sound played the channel's sound. The SDK now posts such a push on a channel derived from the one it would use, with the same importance and settings and that sound or no sound (<channelId>__snd_<name> or <channelId>__silent), created the first time a push uses that sound. A push with sound none plays no sound and does not vibrate; a push with a custom sound keeps the vibration of its channel. A sound your app doesn't bundle, or a channel you created with its own sound, keeps the channel's sound. This applies to standard and carousel pushes, however they arrive. If the user has turned that channel off, the push stays off; if the user changes the channel's settings later, the SDK re-creates its derived channel to match (its id may gain a __v<n> suffix). A sound name is matched to your bundled sound in lower case, ignoring characters other than letters, digits and _.
  • Turning notifications on registers the device and recovers missed pushes right away. When the user allows notifications after first declining them — from the permission prompt or in system settings — the push token is registered with Swan at once and the missed-push check runs at once, instead of on a later app open.
  • subscribePush() re-registers the device before it checks for missed pushes. When the push token had not changed, subscribePush() could run the missed-push check first and register the device minutes later, so the push setup took effect late. The device is now registered first.
  • Fewer requests when the network is down. Several events tracked at once while sends are failing no longer start a send each; they share one, so the first retry round sends at most three requests.
  • A request the server accepts with an empty answer is no longer resent. A push subscribe or unsubscribe, a profile update or a push receipt that the server accepted with an empty or non-JSON answer (for example HTTP 204) was treated as failed and sent again on every flush; any 2xx answer now counts as sent.
  • A new install registers its push token as soon as the device is registered. On the first launch the push token could arrive before the device finished registering with Swan; it was then not sent until a later launch, so the new install could not receive pushes during its first session. It is now sent as soon as registration completes.
  • Events queued during an outage are kept and retried. An event was given up on after three failed sends, even when the sends failed only because the device was offline or the server was briefly unavailable, so an outage longer than a few flush attempts lost events. Network errors, timeouts and HTTP 408, 429 and 5xx answers now keep the event queued and retry it with backoff (up to 60 seconds apart, honouring Retry-After) until it is sent. An event is dropped only when the server rejects it (any other 4xx) on three attempts, when it is still unsent 7 days after it was tracked, or when the queue is full (5,000 events) and the oldest events make room for new ones; the SDK logs each drop. Failed sends during an outage never count toward those three rejections. When the server rejects a whole request (HTTP 4xx, including 413 for a request that is too large), the SDK resends its events one at a time right away, so only the event the server rejects on its own is charged and the others are delivered. If the server answers HTTP 5xx three times in a row for the same batch, the SDK resends its events one at a time, so an event the server always fails on no longer holds up the events queued behind it for up to 7 days. If the first single send fails, the SDK sends the newest queued event on its own to check whether the server is up: if it is, the events behind the failing ones are still delivered; if not, it treats it as an outage, stops, and retries later without counting anything. An event is counted as rejected for HTTP 5xx only after it has already failed on its own in an earlier attempt and fails on its own twice more while newly queued events are being accepted in two attempts in a row (and never more such events than were accepted), so an event is never dropped as rejected because the server failed requests at random (the 7-day limit and the 5,000-event cap still apply), and several events the server can't process no longer hold up the queue. While the server's Retry-After wait is running, no flush sends queued events, whatever starts it — the periodic flush, a full batch, the app returning to the foreground, or an explicit flush. Events dropped because the queue is full (5,000 events, oldest first) are now counted and logged like other drops. A rejected tracked event no longer stops a push subscribe or unsubscribe, a user-detail update or a push receipt queued with it from being sent. Events an earlier version had given up on in the last 7 days are sent again after the update. A response that doesn't confirm an event — no entry for it, or no readable list of results — now leaves the event queued and retried, neither counted as rejected nor treated as sent.
  • appLaunched and other early events carry country, currency and businessUnit on every launch. These values were kept only in memory, so on each launch the events the SDK sent before your code set them again — appLaunched above all, and also a launch in the background (for example when a push arrives) — went out without them. The SDK now keeps them across launches until you change them (an empty string clears one) and applies them before it sends its first event. On the very first launch, set them right after SwanSDK.getInstance(...) so the first appLaunched carries them. A changed value applies to every event tracked after the change, and an event keeps the values it had when it was tracked — previously an event could pick up a value set after it was tracked, if it was still waiting for the SDK to start.
  • unsubscribePush() now keeps the device unsubscribed. After unsubscribePush(), the next app launch, a push token refresh, a call to requestNotificationPermission(), or a login or logout registered the token with Swan again, so a customer who turned notifications off kept receiving pushes. The device now stays unsubscribed until your app calls subscribePush(). Upgrading from 2.9.x or earlier: those versions did not remember a push opt-out after the app restarted. A device that unsubscribed on them and has not restarted since stays unsubscribed after the update; one that restarted since was registered again. For customers who have opted out, call unsubscribePush() after updating, so their choice is kept from now on.
  • The SDK no longer registers a push token at launch when notification permission isn't granted. The token is registered once permission is granted through requestNotificationPermission().
  • With push turned off, the SDK no longer creates a push token. While the device is unsubscribed (unsubscribePush()), the SDK no longer asks Firebase for a push token at launch or when notification permission is granted, and getPushToken() resolves to null until your app calls subscribePush(). Firebase creates a new token whenever one is asked for after unsubscribePush() deleted the previous one, so every launch used to create a token that was never used.
  • Turning push off and back on always ends with push on. Push subscribe and unsubscribe requests are now sent ahead of other queued events, in the order they were made. When more events were waiting than one send carries (for example after the app was offline), an unsubscribe could reach Swan after the later subscribe, so the device ended up unsubscribed while the app showed push on.
  • A Swan campaign link that opens the app now reaches your DEEP_LINK_OPENED listener. When a Swan campaign link (email, SMS, WhatsApp) launched the app, the SDK emitted DEEP_LINK_OPENED before your app had registered its listener, so the event was lost and the app stayed on its home screen; the same link opened while the app was running worked. The SDK now keeps the link and delivers it once, when your app registers its first DEEP_LINK_OPENED listener (to every DEEP_LINK_OPENED listener registered at that moment, as for a live link). Only the most recent link is kept, and a link no listener picks up within 60 seconds is dropped, so an old link is never replayed later. A listener that is already registered receives the link at once, as before.
  • A backlog of queued events is sent quickly once the connection is back. The SDK sent one batch of 10 events per flush, and the next batch waited for the next periodic flush, so a backlog of 200 events took about 10 minutes to send. After a batch is accepted, the SDK sends up to 100 more batches of 10 straight away while events are still queued; any left after that go out with the next regular send. While the server is failing, the retry backoff and the server's Retry-After wait apply exactly as before, and events the server rejected wait for their retry delay.

[react-native/2.9.5] — 2026-10-18

Distribution: npm — @loyalytics/swan-react-native-sdk@2.9.5 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+ (verified through 0.86)

iOS: update your Notification Content Extension. After upgrading, re-run node node_modules/@loyalytics/swan-react-native-sdk/scripts/setup-ios-extension.js. It replaces the SwanNotificationServiceExtension and SwanNotificationContentExtension folders, so re-apply any edits you made to them. No Xcode changes are needed. Without this step, taps on carousel images on iOS can arrive without keyValuePairs.

Fixed

  • Events are no longer held back after the device was briefly offline. If the SDK tried to send events while the device was offline, event sending could stop until the app was restarted, so events, including those sent at sign-in and sign-out, stayed queued on the device. Sending now resumes as soon as the device is back online.
  • PUSH_NOTIFICATION_RECEIVED now fires. Listeners added with addEventListener(SwanSDK.EVENTS.PUSH_NOTIFICATION_RECEIVED, …) were never called. They now receive each push message that arrives while the app is in the foreground, once, including silent pushes. How notifications are displayed is unchanged.
  • Carousel push taps now include the push's keyValuePairs. Tapping a carousel push delivered an empty keyValuePairs object to NOTIFICATION_OPENED and DEEP_LINK_OPENED, so apps could not read the custom data sent with the campaign. Carousel taps now carry the same keyValuePairs as other push taps.
  • DEEP_LINK_OPENED now fires for push taps in apps that do not listen to NOTIFICATION_OPENED. Those apps received no push taps through DEEP_LINK_OPENED. A tap that opens the app before the listener is added is now held and delivered to the first DEEP_LINK_OPENED listener, as NOTIFICATION_OPENED already did. Apps that listen to both events still receive each tap once per event.
  • Carousel clicks now include the card that was tapped. The click the SDK reports to Swan for a carousel push did not say which card was chosen; it now does. A tap that does not choose a card is reported as a click on the push, as before: on Android, a tap on the notification outside the cards or on an auto-advancing carousel; on iOS, a tap on the collapsed notification. Clicks waiting on the device to be retried keep the card.

[react-native/2.9.4] — 2026-09-22

Distribution: npm — @loyalytics/swan-react-native-sdk@2.9.4 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+ (verified through 0.86)

Fixed

  • Signed-in customers stay signed in after upgrading from an older SDK build. Some devices upgrading from an early SDK build silently reverted to an anonymous profile — the app still treated the customer as logged in while the SDK had lost the identity, stranding that customer's events, push subscription and journey state on a profile the device could no longer reach. Upgrading devices now carry their existing identity forward instead of re-registering as anonymous.
  • Profile updates and push-subscription changes now always apply to the customer who was active when the change was made. These updates are queued and sent in the background; previously, if a login or logout happened — or the send was retried — before the queue flushed, the update could be written against the wrong customer. Each queued update now records the customer it was made for and is always applied to that customer.

[react-native/2.9.3] — 2026-08-18

Distribution: npm — @loyalytics/swan-react-native-sdk@2.9.3 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+ (verified through 0.86)

Fixed

  • Push delivery and click receipts are now reported reliably. Previously, if the device was briefly offline the moment a push arrived — most often when the app had been force-closed — the delivery or click receipt for that push could be lost, under-counting delivery and engagement. Receipts are now saved on the device as soon as a push is handled and are automatically retried the next time the app launches or returns to the foreground, so a momentary network drop no longer loses them. Unsent receipts are retained for up to 7 days.
  • Push notifications are no longer delayed by receipt reporting. Sending a delivery receipt no longer blocks the notification from being displayed, so a slow or unreachable network can no longer hold up the push.

[react-native/2.9.2] — 2026-06-25

Distribution: npm — @loyalytics/swan-react-native-sdk@2.9.2 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+ (verified through 0.86)

Fixed

  • The Android module now builds on every supported React Native, from 0.70 through 0.86. Earlier 2.9.x builds failed to compile on React Native 0.83, leaving apps on the current React Native line unable to add the SDK. Compatibility is restored across React Native 0.70–0.86.
  • Events now always carry the correct device identifier. In earlier builds the device identifier could be sent empty on events for returning users, affecting device-level attribution in analytics. It is now populated correctly on every event.

[react-native/2.9.1] — 2026-06-22

Distribution: npm — @loyalytics/swan-react-native-sdk@2.9.1 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+

Fixed

  • Notification channels created with a custom sound now register correctly on Android. Creating a notification channel that specified a custom sound previously failed and left the channel uncreated; channels created without a custom sound were unaffected. Custom-sound channels are now created as expected.
  • Carousel notification text is now readable on dark notification shades. Carousel push notifications previously used hardcoded dark text that became unreadable when the OS drew the notification shade in dark mode; the text now adapts to the light or dark shade.

[react-native/2.9.0] — 2026-06-16

Distribution: npm — @loyalytics/swan-react-native-sdk@2.9.0 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+

Added

  • Runs on both the legacy and the new React Native architecture. Host apps that have the new architecture enabled (TurboModule + Fabric) and host apps that remain on the legacy bridge are both supported. The SDK matches the host app's architecture automatically; no SDK configuration is required and existing integrations continue to work unchanged.
  • networkStateChanged event. Subscribe via addListener('networkStateChanged', …) to be notified when device connectivity changes; the listener receives { online: boolean } on every transition between online and offline.

Fixed

  • Logging out now starts a fresh anonymous identity. When a user who first used the app anonymously and later signed in subsequently logs out, the SDK begins a new anonymous identity instead of reusing the one that had been merged into their account on sign-in. This prevents activity after logout from being attributed to the signed-out user.

[react-native/2.8.0] — 2026-05-06

Distribution: npm — @loyalytics/swan-react-native-sdk@2.8.0 Platforms: iOS 13.0+ · Android API 21+ · React Native 0.70+

Added

  • sdk.identify(identifier, data?) — assert a known user's identity to the SDK on app launch without emitting a USER_LOGIN event. Idempotent and safe to call on every cold start where the host app already has an active session. Use login(...) from your credential-submit handler (which still emits USER_LOGIN); use identify(...) from your bootstrap path so analytics counts stay clean across app upgrades and re-installs. Returns { CDID, profileSwitched }; transient network errors are swallowed and a stale identity is returned so callers don't need a try/catch in normal operation.

Fixed

  • Foreground and background push handlers fall back to notification.title / notification.body when the FCM data.title / data.body fields are absent, eliminating notifications that displayed with blank content for campaigns that only populated the notification envelope.

Changed

  • Default Android notification channel display name renamed from "Swan Notifications" to "Notifications". The channel ID swan_notifications is unchanged, so existing user notification preferences persist across the rename.

On this page