RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.27k stars 303 forks source link

StoreKit2 - Sandbox Purchases reporting in wrong currency but correct price value #1707

Closed robm92 closed 2 years ago

robm92 commented 2 years ago

Original Thread here - https://community.revenuecat.com/sdks-51/sandbox-purchases-reporting-in-wrong-currency-but-correct-price-value-1734?postid=5360#post5360

I have setup an Apple App Store sandbox account to make purchases using the SDK.

My products on AppStore Connect have multiple region prices set

My GBP price is £6.99

My USD price is $8.49 (and is displayed correctly in app when I set the store locale as such)

When I make a purchase in GBP (shown correctly by iOS SDK) the Event Data shows the correct price value (price_in_purchased_currency) for GBP but the ‘Currency’ is incorrectly in USD.

{ "app_id": "app91a2d785de", "app_user_id": "$RCAnonymousID:5cb684d5429346688102439d2892be77", "country_code": "GB", "currency": "USD", "entitlement_ids": [ "Backstage" ], "environment": "SANDBOX", "event_timestamp_ms": 1655385097458, "expiration_at_ms": 1657977095000, "is_family_share": false, "offer_code": null, "period_type": "NORMAL", "price": 6.99, "price_in_purchased_currency": 6.99, "product_id": "backstage_monthly", "purchased_at_ms": 1655385095000, "store": "APP_STORE", "takehome_percentage": 0.7, "transaction_id": "StoreKitTest_Transaction_1655385095000_0" }

Setting usesStoreKit2IfAvailable to false results in correct behaviour:

{ "app_id": "app91a2d785de", "app_user_id": "$RCAnonymousID:b104f5044c464a939be32b53893dea7e", "country_code": "GB", "currency": "GBP", "entitlement_ids": [ "Backstage" ], "environment": "SANDBOX", "event_timestamp_ms": 1655390189958, "expiration_at_ms": 1657982187000, "is_family_share": false, "offer_code": null, "period_type": "NORMAL", "price": 8.490511034020349, "price_in_purchased_currency": 6.99, "product_id": "backstage_monthly", "purchased_at_ms": 1655390187000, "store": "APP_STORE", "takehome_percentage": 0.7, "transaction_id": "StoreKitTest_Transaction_1655390187000_0" }

beylmk commented 2 years ago

Hey @robm92, thanks for opening the ticket and providing all those details...just wanted to let you know that I've been able to reproduce the issue and am investigating what could be causing it!

beylmk commented 2 years ago

Hi @robm92 can you confirm which version of the SDK you're on? I believe this is fixed in our latest release, 4.6.1..

robm92 commented 2 years ago

I can confirm updating to 4.6.1 has fixed the issue. I was running 4.5.2... sorry about that.

aboedo commented 2 years ago

@robm92 no worries and thanks for opening the ticket! I'll close it out for now but let us know if you run into anything else. Have a great day!

github-actions[bot] commented 2 years ago

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.