Skip to content

[Swift] Add runtime iOS version to user agent#270

Closed
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
cx-ios-version-user-agent
Closed

[Swift] Add runtime iOS version to user agent#270
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
cx-ios-version-user-agent

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Stack Context

This PR updates the Swift Checkout Kit user-agent suffix so checkout WebView traffic and Accelerated Checkouts GraphQL traffic include the actual runtime iOS version.

What?

  • Adds an iOSVersion/<UIDevice.current.systemVersion> token to the existing ShopifyCheckoutKit/... (iOS;Swift ...) metadata suffix.
  • Updates UserAgentTests expected strings to include the dynamic runtime iOS version.
  • Adds focused test coverage that documents the runtime iOS version token.

Why?

WebKit/Safari can report a frozen built-in iOS user-agent value such as 18_7, which makes iOS 26 traffic difficult to distinguish. Checkout Kit already appends a custom user-agent suffix through the shared UserAgent.string(...) path, so adding a stable machine-readable token there gives observability the actual runtime iOS version without changing public API.

Validation

  • shadowenv exec --dir /Users/ko/.claudex/worktrees/Shopify@checkout-kit/cx-ios-version-user-agent -- /opt/dev/bin/dev swift test UserAgentTests
  • shadowenv exec --dir /Users/ko/.claudex/worktrees/Shopify@checkout-kit/cx-ios-version-user-agent -- /opt/dev/bin/dev swift lint
  • shadowenv exec --dir /Users/ko/.claudex/worktrees/Shopify@checkout-kit/cx-ios-version-user-agent -- /opt/dev/bin/dev swift api check

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kieran-osgood-shopify kieran-osgood-shopify changed the title Add runtime iOS version to user agent [Swift] Add runtime iOS version to user agent Jun 10, 2026
@github-actions

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.59% (316/345) 87.25% (178/204) 100% (82/82)

@markmur markmur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes to make sure we don't ship this one without a thorough review of the App Store rules first.

Based on our internal conversation: Apple are likely to block apps identifying the iOS version since pulling the version from their default UA was intentional in the release of iOS 26.

@kieran-osgood-shopify kieran-osgood-shopify added the #gsd:50662 Rebase Checkout Kit on UCP label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants