# iOS SDK - Changelog

All notable changes to the Glomo iOS SDK.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). From 1.0.0 the public API follows [Semantic Versioning](https://semver.org/) - breaking public API changes require a new major release.

## [1.3.0] - 2026-11-27

A feature release. No API changed and no existing call site needs to move - both new listener methods carry protocol-extension defaults.

### Added

- **`GlomoPayListener.onCheckoutStageChanged`**, reporting how far a customer got through an LRS checkout. It fires each time they reach a new stage - bank selected, details submitted, bank authentication, handed off to the bank, awaiting confirmation - and carries the bank, the journey type and the step within a stage where there is one. Stages arrive in order and each stage and step pair fires at most once, so a drop-off funnel can be built by appending.
- **`GlomoPayListener.onCheckoutClosed`**, delivered at most once per checkout with the last stage the page reported and why it ended (`user_dismissed`, `user_cancelled`, `completed`, `error`, `confirmation_timeout`). This is what lets a customer who abandoned at the bank be told apart from one who never chose a bank.
  - When the customer swipes the sheet away, taps Close or leaves the SDK's connection-error screen, the SDK reports the close itself - `completed` after a successful payment, `error` after a failed one or from the error screen, `user_dismissed` otherwise.
  - A checkout closed by your own code before it reached a payment result reports none.
  - On a declined payment `lastStage` is the stage before `failed`, because the page reports the failure ahead of that stage and the checkout closes on the failure.
  - It is not a payment outcome: after a dismissal the payment can still complete on the server, so read that from the payment status API or your webhook.
- **`GlomoCheckoutStageChangedEvent`, `GlomoCheckoutClosedEvent`, `GlomoCheckoutResource`, `GlomoCheckoutSegment`**, and the `GlomoCheckoutStages` / `GlomoCheckoutCloseReasons` constants. The event types are `Sendable`.


Both callbacks need checkout progress events switched on for your business - talk to your Glomo contact. Until then the checkout behaves exactly as it does today and neither fires. Only v1 payloads are delivered: an empty or differently versioned payload reports nothing. `onPaymentTerminate` is unchanged; `onCheckoutClosed` adds where the customer stopped rather than replacing it, and on the close path `onPaymentTerminate` comes first - though a late one can still land while the sheet dismisses.

Treat `stage`, `step`, `provider`, `method` and `reason` as open strings: new values can appear without a new payload version, and the SDK forwards them rather than filtering them out.

**Source-compatible**: both have default implementations in a protocol extension, so an existing listener compiles and behaves unchanged.

See [Checkout progress events](/platform/sdk/ios-sdk/v1#checkout-progress-events), and [Checkout events](/platform/sdk/checkout-events) for the contract the callbacks relay.

Part of the [v1 documentation](/platform/sdk/ios-sdk/v1).

## [1.2.0] - 2026-11-12

A security and correctness release. No API changed and no call site needs to move. Two sets of visible behaviour: which pages may speak to the SDK, and what the SDK paints before the checkout page does.

### Changed

- **Payment and page-lifecycle bridge messages are now accepted only from Glomo checkout pages, and only from a page's main frame.** The bank and 3-D Secure pages shown in the redirect overlay can no longer report a payment result or put a checkout on the error screen. Bank-driven navigation is unaffected: a bank page closing the overlay after a 3-D Secure challenge works exactly as before. No integration change is required, and the callbacks your app receives from a normal payment are unchanged. See [Origin Policy](/platform/sdk/ios-sdk/v1#origin-policy).
- **The main checkout web view is now restricted to Glomo origins.** It only ever loaded Glomo pages; that is now enforced rather than assumed, and a top-level navigation anywhere else is blocked. Subframe loads - card entry, 3-D Secure, server-to-server - are unaffected, and the bank redirect overlay is deliberately not restricted by host, since the bank decides where it goes next.
- A refused message and a blocked navigation are both recorded in the SDK's own diagnostics, by origin rather than by URL, and neither reaches `onSdkError` or ends the checkout.
- The injected `message` relay now forwards only same-document messages. A third-party frame embedded in a Glomo page can no longer have a payment event relayed on its behalf.
- The trusted-origin rule matches Glomo domains by suffix rather than by an exact host list, so a checkout host that moves or redirects between `glomopay.com` and `glomo.one` keeps working in an SDK version that shipped before the move. Configured origins that are not on a Glomo domain - the education carousel and a self-hosted checkout - are trusted exactly as before.
- **Three visible changes on upgrade from 1.1.0**, all of them the intended end state. The account setting cannot roll them back; only a downgrade can. See [Dark mode](/platform/sdk/ios-sdk/v1#dark-mode).
  - Dark mode **off** for your account: a host app on `.dark`, or on `.auto` with the device in dark, used to show a dark screen in front of a checkout that then rendered light. It is light throughout now.
  - Dark mode **off** for your account: the loading screen followed the device, so a `.light` host app on a dark device showed a dark loading screen before a light checkout. It is light now.
  - Dark mode **on** for your account: the loading screen is light until the order loads and then dark, where it used to be dark from the first frame. The gap is one order request, and it closes before the page paints.
- The dark loading screen uses the checkout page's own background colour rather than black, so there is no seam at the edges while the page settles.
- Checkouts opened with an explicit `orderType`, and subscription checkouts, stay light throughout: those paths do not load the order, so the account setting is not available to them.


### Fixed

- The checkout no longer paints a colour scheme the page will not render. What the SDK draws before the page's first paint - the loading screen, the checkout web view and the LRS education carousel - now follows both the scheme your app asked for and whether dark mode is switched on for your Glomo account. What is sent to the page is unchanged: `appColorScheme` still reaches it in full and the page still decides.
- A web view told `light` no longer reports `dark` to the page's own `prefers-color-scheme` media query, which could render part of the checkout in the wrong scheme.


Part of the [v1 documentation](/platform/sdk/ios-sdk/v1).

## [1.1.0] - 2026-10-29

A feature release. No API changed and no existing call site needs to move - `appColorScheme` is defaulted and goes last in the initialiser.

### Added

- **`GlomoPayConfig.appColorScheme`** (`.auto` | `.light` | `.dark`, default `.auto`) provides the Glomo checkout page the preferred colour scheme. It requests rather than forces: the page decides (based on backend configuration), against your merchant dashboard settings.
  - `.auto` follows the checkout's own trait collection, so an app that sets `overrideUserInterfaceStyle` gets what it set. The parameter is defaulted and goes last, so existing `GlomoPayConfig` call sites compile unchanged.
- **`GlomoPayCheckoutHandle.setAppColorScheme(_:)`** changes the scheme of a checkout that is already presented. The page is told through the bridge rather than reloaded, so a payment in flight survives the change. A host appearance change reaches an open checkout on its own while the scheme is `.auto`.
- **`GlomoColorScheme` enum.**


See [Dark mode](/platform/sdk/ios-sdk/v1#dark-mode), and [Dark mode across the SDKs](/platform/sdk/dark-mode) for how the same property resolves on the other Glomo SDKs.

### Changed

- Improved SDK diagnostics and observability revamp to better assist merchants.
- The checkout and carousel web views now have their `overrideUserInterfaceStyle` pinned to the scheme the checkout resolved. `WKWebView` reports `prefers-color-scheme` from its trait collection, which inherits the host app, so without this a page told `dark` would still match `prefers-color-scheme: light` in its own CSS and render half of each. Nothing to configure.


Part of the [v1 documentation](/platform/sdk/ios-sdk/v1).

## [1.0.0] - 2026-10-01

The first stable release. The public contract is aligned with the Flutter and Android SDKs.

### Breaking

- **Minimum supported iOS is now 16.0**, and distribution is Swift Package Manager only. CocoaPods support is removed.
- **`onUserJourneyCompleted` is a new required callback** with no protocol-extension default, so every integration must implement it. Required on purpose: the order decides server-side whether bank transfers are enabled, so a default body would let a host upgrade, keep compiling, and silently stop hearing about a journey it used to be told about.
- **`payment.bank_transfer_submitted` no longer reaches `onPaymentSuccess`.** Hosts that fulfil orders from `onPaymentSuccess` were being told a payment had completed when no money had moved. It now arrives at `onUserJourneyCompleted` with a `GlomoPayUserJourneyPayload`.
- **`GlomoPayListener.onEvent` is removed**, along with its protocol-extension default. It was never part of the integration contract; everything with diagnostic value moved to the SDK's own telemetry, which is sanitised and does not depend on a host implementing anything.
- **`autoCloseOnConnectionError` moved onto `GlomoPayConfig`.** It was a property on the checkout view controller, which `startCheckout` constructs internally and never exposes, so no merchant integrating from the documentation could reach it.
- **`startCheckout` now returns a `GlomoPayCheckoutHandle`.** Retain it to dismiss that session with `close()`; the listener then receives `onPaymentTerminate(.programmatic)` once.
- **`CheckoutStatus`, `TerminationSource.backButton` and `GlomoPayResult` are removed** from the public surface. `backButton` has no meaning on iOS: the escapes are the navigation bar's Close button and interactive sheet dismissal, both reported as `userDismiss`.


### Added

- `GlomoPayUserJourneyPayload` and `GlomoPayUserJourneyType`, carrying the journey type, order ID, sender account number, transaction reference, status and raw response. Journey fields are read in both camelCase and snake_case; a payload with no `orderId` is rejected rather than delivered.
- A 15-second advisory render timeout. There was previously no timeout of any kind behind the loading state, so a page that never rendered left the user on a spinner with no error, no retry and no callback. It reports `onConnectionError` with `shouldAutoClose` false and shows a retry surface.
- The LRS education carousel above the bank page, with the same proportions as the Flutter SDK. It appears only when the checkout page signals it has content, matching the React Native SDK; silence leaves it hidden.
- `Validator.isValidUrl`, gating every URL the page asks to open. `URL(string:)` is a parse, not a check, so `javascript:`, `data:` and `file:` URLs from the page were becoming navigations.
- A `window.opener` stub in the flow injection, so bank pages that report results through `opener.postMessage` are heard instead of completing at the bank silently.
- Every user-facing string moved into a `GlomoPayLocalizable` table a host can override, and the bank-flow error path gained a real surface with retry and cancel controls. The main error panel gained a Cancel button.


### Changed

- **The `sentry-cocoa` dependency is removed.** Swift Package Manager resolves one version of a package for the whole app, so any merchant on a different Sentry version could not install this SDK at all. SDK error reporting now sends its envelopes over `URLSession` with the same content. No public API change, and a host can use any Sentry version alongside the SDK, or none.
- **`onPaymentFailure` is delivered on the checkout's failure event** instead of requiring a signature that a failure payload has never carried. The callback previously could not fire for a backend-confirmed decline in any build, and the host received an SDK error describing the SDK's own guard instead.
- **Order-fetch failure terminates the checkout and reports the cause** instead of resolving to standard and opening the standard checkout, which routed LRS orders to the wrong host. A timeout or transport failure reports through `onConnectionError`; a non-2xx status or an unparseable response through `onSdkError`.
- API error cases now travel to the caller instead of being flattened into a single network error, and no case carries the response body any more.
- The checkout's web views share one non-persistent website data store instead of the app-wide default, which was never cleared: checkout cookies, local storage and cache were persisting into the merchant application's own web views and into the next checkout.
- Every host callback goes through one delivery point on the main queue. The listener is weak, which previously meant a host passing an object it did not otherwise retain got no callbacks and no signal at all; a released listener is now recorded in diagnostics. The retention contract is documented at the `startCheckout` call site.
- `shouldAutoClose` is decided from the mapped error type instead of the sign of the error code. Every `NSURLErrorDomain` code is negative and every `WKErrorDomain` code is positive, so the old rule closed on all unmapped iOS errors and exempted genuine WebKit failures.
- Pay via Bank is not supported on the iOS SDK, matching the Flutter SDK. There is no journey member for it and no event behind it. See [Pay via Bank](/payin/payment-methods/pay-via-bank) for that method's current availability.


### Fixed

- Back in the bank overlay always closes the overlay instead of walking the bank page's history, which made the exit unreachable once a redirect chain left history behind. Edge-swipe history gestures are disabled on both web views.
- The bank flow overlay allows only `http`, `https`, `about`, `blob` and `data` navigations. WebKit never hands an unknown scheme to the system, so such a navigation previously failed silently and left the user on a bank page that appeared to have done nothing.
- A cancelled navigation is no longer reported as a connection error. WebKit delivers those routinely for superseded loads, client-side redirects and explicit stops, and with auto-close it terminated live checkouts for a non-event.
- Removed a duplicate dependency-load-failure handler that tracked the same failure twice for one message. The page's failure keeps the page's own name.


### Removed

- The SDK's own document picker. WebKit's upload sheet offers Camera, Photo Library and Files on every supported iOS version, and the SDK's replacement removed those capture options on iOS 18.4 and later - on KYC fields where photographing a document is the common case. Hosts must declare `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription`, because WebKit presents those options from the merchant application's process.


Part of the [v1 documentation](/platform/sdk/ios-sdk/v1).

## [0.0.1] - 2026-08-01

Initial pre-stable release. Not covered by the Semantic Versioning guarantee that starts at 1.0.0.

### Added

- Initial native Swift SDK package for iOS 15 and later, distributed through both Swift Package Manager and CocoaPods.
- Typed checkout configuration, payload, result, error, and listener contracts.
- Native modal `WKWebView` checkout with loading, retry, navigation, and cancellation handling.
- Standard and LRS checkout support with automatic order-based detection.
- JavaScript bridge and payment event routing aligned with the Flutter SDK.
- Device compliance checks and test coverage.
- SDK analytics and isolated error reporting, with PII filtering, bank redirect URL sanitization, and a privacy manifest.


## Related

- [iOS SDK v1 documentation](/platform/sdk/ios-sdk/v1) - latest version (v1.3.0)
- [Dark mode across the SDKs](/platform/sdk/dark-mode) - what the automatic value resolves to on each Glomo SDK
- [Checkout events](/platform/sdk/checkout-events) - the stage, step and close-reason contract behind the v1.3.0 callbacks
- [iOS SDK overview](/platform/sdk/ios-sdk)
- [Android SDK](/platform/sdk/android-sdk) - Glomo SDK for native Android apps
- [Flutter SDK](/platform/sdk/flutter-sdk) - Glomo SDK for Flutter apps