iOS
Release history for the Swan iOS SDK.
[ios/1.6.0] — 2026-10-30
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.6')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Added
- Pushes received in the foreground are reported as delivered.
handlePushNotificationUserInfo(called fromwillPresent) now reports delivery, so a push that arrives while the app is open is counted even when your Notification Service Extension does not see it. The same push is counted once when both the extension and the app see it, and a manualackPushDeliveredcall for a push already reported is ignored. - Delivery and tap receipts for pushes sent by the Swan platform. Receipts are saved in the App Group and retried automatically if the device is offline, and the same receipt is never counted twice. Receipts need no sign-in: the extension reports delivery whether or not the customer is signed in.
- Carousel card taps on pushes sent by the Swan platform report which card was tapped, when your Notification Content Extension records the tapped card as it does for other pushes. Add the card's
cardIndex(CarouselPayloadPublic.Item.cardIndex) to the click data next toitemIndex. Templates.layoutDirection(_:)tells a custom Notification Content Extension when a carousel's content is right-to-left (for example Arabic), so the carousel can be mirrored.Swan.shared.subscribePush()(Objective-C:[[SwanObjC shared] subscribePush]) turns push back on afterunsubscribePush(). It registers the latest push token the SDK has received with Swan; if none has arrived yet, the next token your app forwards is registered. WhenunsubscribePush()andsubscribePush()are called in quick succession, the last call wins. Call it from your in-app "turn notifications on" control.
Changed
- Listener payloads identify the push by its Swan message id (
data.messageId) when the push carries one, including in the Notification Service Extension. - Silent pushes are now reported as delivered (through
handlePushNotificationUserInfo). They are still never reported as tapped.
Fixed
- 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 report was sent again the next time the app opened. The extension now finishes once the report is confirmed, waiting at most 8 seconds; the notification is shown as before.
- A tap on card 2 of a right-to-left carousel was reported as card 3. The sample Notification Content Extension's right-to-left carousel opened at the far end: it showed the last card's image under card 1's text, and after one swipe a tap opened and reported the wrong card. It now opens on card 1, so the card a user taps is the card that is reported. If you built your own carousel from it, scroll to the first card once it is laid out — see Custom Notification Content Extension for carousel.
- 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'sRetry-Afterwait 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. 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. appLaunchedand other early events carrycountry,currencyandbusinessUniton every launch. These values were kept only in memory, so on each launch the events the SDK sent before your code set them again —appLaunchedabove all — went out without them, and a value set beforeSwan.shared.initialize(...)was ignored. The SDK now keeps them across launches until you change them (an empty string clears one), applies them before it sends its first event, and applies values set beforeSwan.shared.initialize(...). On the very first launch, set them beforeSwan.shared.initialize(...)so the firstappLaunchedcarries 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 tracked before the device was registered took the values current at registration.unsubscribePush()now keeps the device unsubscribed. Apps forward their push token withregisterAPNsTokenHex(_:)(orregisterAPNsToken(_:)) on every launch, and that call registered the device with Swan again, so a customer who turned notifications off kept receiving pushes. AfterunsubscribePush(), forwarding the token no longer registers it — across launches, token changes, login and logout — until your app callssubscribePush(). Keep forwarding the token as before. Upgrading from iOS 1.5.4 or earlier: those versions did not remember a push opt-out after the app restarted (the device was registered again at the next launch), so a device that unsubscribed on them counts as subscribed after the update. For customers who have opted out, callunsubscribePush()after updating, so their choice is kept from now on.
[ios/1.5.4] — 2026-10-18
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.5')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Added
- Carousel click receipts can say which card was tapped. This applies when your own Notification Content Extension records card taps in your App Group under
swanTemplateClickData; apps that show carousels only through the Notification Service Extension are not affected. Next toroutein the click data your extension writes, additemIndex: the tapped card's 0-based position in the push'scarouselItems, which isTemplates.CarouselPayloadPublic.Item.position. The click receipt for that tap then carries the sameitemIndex, including when a receipt that failed to send is retried later. A tap on the notification itself, a standard push and the delivery receipt never carryitemIndex. Click data withoutitemIndexworks as before: the card's route opens and the receipt doesn't say which card was tapped. If your extension already writesitemIndex(for example, one carried over from a React Native app), check it before you upgrade: the SDK now sends the value your extension writes, so it must be the card'sposition(not its index among the cards on screen) and must be left out when the tap didn't come from a card. See Open the tapped card and report which card it was. Templates.CarouselPayloadPublic.Item.position— each parsed card's 0-based position in the push'scarouselItems. In the filmstrip layout, cards without an image are left out ofitems, so a card'spositioncan differ from its index initems. WritepositionasitemIndex.
Fixed
- A tapped carousel card now opens when your app passes the notification's own id. If your app called
handleNotificationUserInfo(_:messageId:)withresponse.notification.request.identifier, the SDK didn't match it to the card tap your Content Extension had recorded, so the push'sdefaultRouteopened instead of the tapped card's route. The SDK now matches the tap against the push'smessageId/gcm.message_idas well as the id you pass. Apps that callhandleNotificationUserInfo(_:)without amessageIdwere not affected. - A login the server reports as failed no longer changes who the device is signed in as. When the server accepted a
login()/identify()call but reported that it couldn't sign the customer in, the SDK still saved the new identifier. On a signed-out device, the device then looked signed in while its events stayed on the anonymous profile, and a laterlogout()did nothing, so the server was never told the customer had signed out. On a device already signed in as another customer, events stayed on that previous customer's profile, and callinglogin()again for the new customer was skipped as "already signed in". A failed login now leaves the device's identity as it was, the same as when the device is offline, and callinglogin()/identify()again retries it. - Events now report the SDK version your app ships. Every event and identity call reported
sdkVersion2.7.3, whichever iOS SDK release was installed, so data in Swan couldn't tell iOS SDK releases apart. The SDK now reports its own release version (1.5.4for this release). Devices on iOS SDK 1.5.3 or earlier keep reporting2.7.3.
[ios/1.5.3] — 2026-09-22
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.5')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Fixed
- Profile updates now always apply to the customer who was active when the update was made.
enrichProfile()is 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 carries the customer it was made for and is always applied to that customer.
[ios/1.5.2] — 2026-08-18
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.5')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
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, or when the receipt was sent from the Notification Service Extension — the delivery or click receipt 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. 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.
[ios/1.5.1] — 2026-06-25
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.5')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Changed
- Device registration resolves the device identifier more robustly. The SDK now reliably obtains the device identifier when registering, so the identifier is consistently available for events and attribution.
[ios/1.5.0] — 2026-06-19
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.5')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Fixed
login()now triggers the full backend pipeline. Previously alogin()call suppressed the backend's downstream side-effects (cart, journey, and messaging triggers) in the same wayidentify()does.login()now runs the complete pipeline, so logging a user in fires those side-effects as expected.identify()is unchanged and continues to switch the profile without those side-effects.- 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.
[ios/1.4.0] — 2026-05-19
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.4')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Added
-
Expanded Objective-C surface on
SwanObjC. Mixed-language host apps can now drive most of the customer-facing SDK from Obj-C call sites without writing a Swift bridging file. The previous facade covered initialization, identity basics, custom event tracking, super-properties, and APNs token registration — about a fifth of the public surface. The new entries close the gap:- Async via completion handlers (Obj-C cannot call Swift
asyncdirectly):loginWithCompletion,requestNotificationPermissionWithCompletion,hasNotificationPermissionWithCompletion,isPushEnabledWithCompletion. Each completes on the main thread. - Device + session state:
getDeviceInfo(returns anNSDictionarymirror ofSwanDeviceInfo, with nested location dictionary if a location has been supplied),getCurrentSessionId,getQueueSize. - Location:
updateLocation:longitude:accuracy:(negativeaccuracyto omit),isLocationEnabled. - Push handling:
handleDeepLink:,handleNotificationUserInfo:(and amessageId:overload),handleNotificationTap:(same),handlePushNotificationUserInfo:,unsubscribePush,ackPushDelivered:,ackPushClicked:type:linkId:,flushPendingAcks. - Notification categories + badge:
createNotificationChannelWithId:name:importance:soundName:,deleteNotificationChannelWithId:,getNotificationChannelId,getBadgeCount,setBadgeCount:. - Lifecycle:
addInitializedListener:.
Listeners that emit typed Swift-struct payloads (
addNotificationOpenedListener,addDeepLinkOpenedListener, the telemetry-event listeners) remain Swift-only — host apps that need them write a small Swift bridging file to adapt the payload into NSObjects. The expandedObjective-C host appssection of the iOS getting-started guide shows the full new surface. - Async via completion handlers (Obj-C cannot call Swift
[ios/1.3.2] — 2026-05-18
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.3')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Fixed
- Swift Package Manager resolution. Installing via SPM with
.package(url: "https://github.com/SwanCX/swan-ios-sdk", from: "1.3.2")(or pinning by version range in Xcode → File → Add Packages…) now resolves a concrete version. The 1.3.0 and 1.3.1 mirrors used a non-SemVer tag scheme that SPM could not interpret as a version. From 1.3.2 forward, the distribution repo uses plain SemVer tags (1.3.2, …). CocoaPods installs (pod 'SwanSDK', '~> 1.3') were unaffected by this issue and continue to work — this release only changes how SPM discovers versions.
[ios/1.3.1] — 2026-05-18
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.3')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Fixed
- CocoaPods install now resolves. The 1.3.0 spec referenced a source location CocoaPods Trunk could not read. 1.3.1 ships identical SDK code with a corrected source reference. Customers on
pod 'SwanSDK', '~> 1.3'will pick this up automatically on the nextpod update.
[ios/1.3.0] — 2026-05-18
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.3')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Fixed
- Carousel notifications now render correctly on iOS 26. Long-pressing a carousel push on iOS 26 previously showed iOS's default banner instead of the swipeable image carousel. The custom carousel UI now displays on iOS 26 the same way it does on earlier iOS versions. Host apps integrating a
UNNotificationContentExtensionshould follow the updated guide atplatforms/ios/EXTENSIONS.mdfor the iOS 26 setup. - Tapping a carousel slide now opens that slide's deep link. Previously, tapping any individual slide opened the carousel's
defaultRouteregardless of which slide was tapped. Per-item routes set on a carousel item now resolve correctly when that item is tapped. - Cold-start taps no longer fire the opened listener twice. Tapping a notification on a killed app now invokes
addNotificationOpenedListenerexactly once on launch. - Listeners registered before
initialize(...)completes now fire reliably. Previously, listeners attached during app startup but before the SDK had finished initializing could miss events that arrived during the init window. - Click deduplication no longer breaks on whitespace. Message IDs with leading or trailing whitespace are now deduplicated correctly; previously they could bypass the 30-second dedup window.
Swan.shared.clearCachedCredentials()no longer wipes unrelated data when sharing an App Group with other SDKs. The reset is now scoped to keys this SDK actually owns.- The Notification Service Extension's delivery ACK on the very first push after install now surfaces a clear warning when credentials are not yet available, instead of silently dropping the ACK.
- Tapping a second carousel notification immediately after the first now records the second tap's per-slide click data correctly. Previously, iOS reusing the Content Extension's view controller could cause the second tap's data to be dropped.
addDeepLinkOpenedListener/addNotificationOpenedListenerun-registration is now deterministic. Calling the returned unregister function removes that specific listener and no others.- Session flushes no longer fire on transient app-state interruptions like Control Center swipes, Face ID prompts, or screenshots. Sessions now flush on actual app-to-background transitions only.
- Tapping the same carousel notification twice in quick succession no longer routes the second tap to the first tap's slide when the host forwards
userInfowithout an explicitmessageIdargument.
Changed
- The sample app's foreground-presentation handler now fires only the delivery ACK for foreground pushes; the "opened" listener fires only on an actual user tap. See
EXTENSIONS.md §3.5for the integration pattern host apps should follow. - Cold-start tap routing now follows iOS's canonical
didReceive(response:)path; host apps no longer need a separatelaunchOptions[.remoteNotification]forwarding block.
Added
platforms/ios/EXTENSIONS.md— host-integration guide for Notification Service Extension + Notification Content Extension, covering iOS 26 setup requirements, foreground vs. tap semantics, per-slide deep-link wiring on carousels, and a troubleshooting matrix.- Sample Notification Content Extension target in
SampleAppXcode/— a working 3-image carousel reference implementation with page control and per-item tap routing that customers can copy as a starting point.
[ios/1.2.0] — 2026-05-17
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.2')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Added
- App Group support for Notification Service Extensions. New
SwanConfig.appGroup: String?field lets the host app share credentials with its NSE process so the extension can firedeliveredACKs even when the host is killed. Pass the same App Group identifier into the newTemplates.handleServiceRequest(request:content:appGroup:completion:)from inside your NSE — a single call fires the delivery ACK and renders the rich content. On first init withappGroupset, the SDK migrates existing credentials from the per-process suite to the App Group suite so upgrading apps don't need to re-register. Templates.handleServiceRequest(request:content:appGroup:completion:)— new public NSE entrypoint that wraps delivery-ACK firing and content rendering in one call.Swan.ackPushDeliveredColdStart(_:appGroup:)andSwan.ackPushClickedColdStart(_:appGroup:)— newappGroup:parameter on the existing cold-start ACK methods so NSE / app-extension callers can read credentials from the shared App Group.
Changed
- The
KeyValueStorenow emits a warning when an App-Group-shapedsuiteName(group.*) fails to open. Almost always a missing or mismatched entitlement.
[ios/1.1.0] — 2026-05-16
Distribution: Swift Package Manager and CocoaPods (pod 'SwanSDK', '~> 1.1')
Deployment target: iOS 13.0+ · Swift 5.9+ · Xcode 15+
Added
- CocoaPods distribution — install with
pod 'SwanSDK', '~> 1.1'alongside the existing Swift Package Manager support. SwanObjCObjective-C facade —@objcMembers NSObjectexposing the most-used operations (initialize,identify,logout,enrichProfile,track,screen,flush, super-properties,registerAPNsToken,getPushToken,isPushReady,enableLogs). Pure-Swift host apps continue to callSwan.shareddirectly; mixed-language apps#import <SwanSDK/SwanSDK-Swift.h>and call[SwanObjC shared] ....- Push token lifecycle listeners —
addPushTokenRegisteredListener(fires on every successful APNs registration),addPushTokenRegistrationFailedListener(fires on subscribe POST failure),addPushTokenRefreshListener(fires only on token rotation, not initial registration). NewPushTokenRegisteredPayload/PushTokenRegistrationFailedPayload/PushTokenRefreshPayloadtypes. Swan.shared.initialize(appId:)andSwan.shared.initialize(appId:config:)— new public overloads. Host apps no longer pass an infrastructure URL in the init snippet.
Changed
Swan.shared.handleDeepLink(_:) -> Bool— exposed as public (was internal in v1.0.0).
Known limitations
- Objective-C facade covers the synchronous, listener-free surface. Async methods (
login,requestNotificationPermission,isPushEnabled) and listener subscriptions with struct payloads remain Swift-only — write a small Swift bridge file if your Obj-C app needs them. - Source distribution only. SPM and CocoaPods both build from the tagged source; no XCFramework binary distribution.
[ios/1.0.0] — 2026-05-16
First production release of the Swan iOS SDK.
Distribution: Swift Package Manager Deployment target: iOS 13.0+ · Swift: 5.9+ · Xcode: 15+
Added
- Core identity —
Swan.shared.initialize,identify,login(async, returnsLoginResult),logout,enrichProfile,swanIdentifier,getDeviceInfo. Anonymous-to-identified profile merge on the backend. - Event tracking —
SwanEvents.screen,Swan.shared.track,customEvent, super-properties (setCountry/setCurrency/setBusinessUnit/setCurrentScreenName), session tracking, offline-first SQLite-backed queue with exponential-backoff retry. - E-commerce events — typed
SwanEventshelpers covering the full catalog (productViewed,productAddedToAddTocart,checkoutStarted,checkoutCompleted,orderCompleted, etc.) — same wire names as Android for cross-platform parity. - Push notifications (APNs) —
registerAPNsToken(_:)/registerAPNsTokenHex(_:), basic + carousel notification templates rendered in aNotification Service Extension, 5 predefinedUNNotificationCategoryids exposed viaSwanNotificationChannels, foreground / cold-start notification routing, click acknowledgement. - Deep linking —
handleDeepLink(_:)for external URLs (Universal Links, custom URL schemes),handleNotificationUserInfo(_:messageId:)for cold-start,handleNotificationTap(_:messageId:)for warm-start, listener model viaaddNotificationOpenedListener+addDeepLinkOpenedListener, 30-second deduplication onmessageId. - Permissions —
requestNotificationPermission()(async),hasNotificationPermission()(async),isPushEnabled()(async combined gate), graceful denied-permission handling. - Location —
updateLocation(latitude:longitude:accuracy:),isLocationEnabled(), opt-in viaSwanConfig.location.enabled(defaultfalse). Host app supplies coordinates; the SDK does not acquire location itself. - Lifecycle listeners —
addInitializedListener,addDeviceRegisteredListener,addDeviceRegistrationFailedListener,addNetworkStateChangedListener,addSwanIdentifierChangedListener,addNotificationOpenedListener,addDeepLinkOpenedListener,addPushPermissionListener. - Public parity types —
SwanConfig,PushNotificationsConfig,LocationConfig,SwanDeviceInfo,SwanLocation,LoginResult,SwanIdentifierChangedPayload(+Sourceenum),PushNotificationReceivedPayload,SwanNotificationChannels. - Log markers — six
[SwanSDK] *log lines emit at key lifecycle points for integration verification.
Known limitations
- Push token lifecycle listeners (
addPushTokenRegisteredListener,addPushTokenRegistrationFailedListener,addPushTokenRefreshListener) are not available in v1.0.0 — see iOS v1.1.0. - Objective-C consumption — the SDK is Swift-only in this release. Pure-Obj-C host apps consume it via a Swift bridging header.