Skip to main content
Question

Users App Store local region and Locale.current device setting discrepency

  • November 10, 2022
  • 2 replies
  • 570 views

Forum|alt.badge.img+1

Hey,

I’m formatting price strings that are returned from RevenueCat (localizedPriceString) in my iOS build but I also need access to the users app store region code to format the currency to and from a floating point number while keeping the correct currency formatting before and after.

The number formatter in xcode uses either ‘Locale.current’ (which the user can change in the phone settings leading to possible incorrect formatting) or a manually specified region code. I need the app store region code to ensure the values that I format are returned in the correct currency format.

Is there anyway RC can supply this?

Cheers,

Matt.

2 replies

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • November 30, 2022

Hey Matt,

Will getting the SKStoreFront from the RevenueCat SDK work? The store front object contains a country code that you may be able to use.


Forum|alt.badge.img+1
sharif wrote:

Hey Matt,

Will getting the SKStoreFront from the RevenueCat SDK work? The store front object contains a country code that you may be able to use.

No this doesn’t work as I hoped. The country code is not what Locale uses to initialize itself. We need access to the current locale. The store kit 2 product contains that locale but its not passed to us through RevenueCat.

Edit.. you can get the the Locale by using:

`package.storeProduct.sk1Product?.priceLocale`


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings