Skip to content

Conversation

@nan-li
Copy link
Contributor

@nan-li nan-li commented Jan 17, 2026

Description

One Line Summary

Fixes an issue where purchase amounts were being formatted using the device's locale settings, causing European locales to send "12,99" instead of "12.99".

Details

  • Fixes an issue where purchase amounts were being formatted using the device's locale settings, causing European locales to send "12,99" instead of "12.99". This caused 400 errors from the API and blocked other attached user property updates.
  • The fix ensures the NSNumberFormatter uses en_US_POSIX locale, which always uses a period as the decimal separator regardless of device locale.

Motivation

Scope

  • In app purchase tracking prices
  • Note that productsRequest:didReceiveResponse: is deprecated after iOS 18. Also, we may drop IAP tracking so there will be a decision made around this. In the meantime, we should make sure updates are being sent correctly.

Testing

Unit testing

The callback productsRequest:didReceiveResponse: is an Apple API, so unable to mock with current test infra.

Manual testing

None

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

- Fixes an issue where purchase amounts were being formatted using the device's locale settings, causing European locales to send "12,99" instead of "12.99". This caused 400 errors from the API and blocked all user property updates.
- The fix ensures the NSNumberFormatter uses en_US_POSIX locale, which always uses a period as the decimal separator regardless of device locale.
@nan-li nan-li requested a review from a team January 20, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: iOS SDK sends invalid "purchases" delta with localized amount ("12,99"), causing OSRequestUpdateProperties to fail with 400

2 participants