Post

Replies

Boosts

Views

Activity

Comment on Missing currencyCode in StoreKit2
I suggest refraining from string parsing tricks if you do not want to have unexpected results at a locale where price strings are not formatted in an expected manner. SkProduct.priceLocale.currencyCode is the way to go. But that is present in StoreKit only and not present in StoreKit2. Our first solution was to explicitly decode the JSON payload StoreKit2 is sending and fetching the currency code from there. This data was eventually removed from the JSON. Our current solution is to mix the StoreKit and StoreKit2 and blend the data. It is quite ugly since the whole point of StoreKit2 is to provide an elegant API. But I would argue this is a safer solution compared to what you suggested. TLDR: Apple should provide currencyCode and/or priceLocale in Product.
Mar ’22