question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose priceLocale for iOS

See original GitHub issue

Use case

We’re offering a monthly and annual auto-renewing subscriptions on our iOS app. We want to display a comparable monthly equivalent price for the annual subscription formatted for the specific App Store locale. As a device can have a different locale from App Store, we cannot rely on the device locale to format the currency price. We also cannot rely on the currency code, for example, the euro formatting varies based on your country.

Proposed solution for iOS

Expose SKProduct.priceLocale string value as part of the getProducts response as product.priceLocaleIOS.

https://github.com/dooboolab/react-native-iap/blob/10af7093f6f26c7473b20c232a4040e70ee5e620/ios/RNIapIos.m#L311-L314

Android

From my brief look into how to solve this for Android, there does not appear to be the equivalent locale information on the Play Store product. We’re currently not targeting Android, but happy to make the change generic if anyone can point me in the right direction.

Would you like me to submit a PR?


Version of react-native-iap

2.3.19

Version of react-native

0.57.0

Platforms you faced the error (IOS or Android or both?)

iOS only.

Expected behavior

Able to further localise pricing information based

Actual behavior

Tested environment (Emulator? Real Device?)

Real device. iPad Air 2.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hyochancommented, Dec 19, 2018

@m-sanders Hi. Any PR is appreciated and we all love to see your work.

0reactions
adorumcommented, Feb 21, 2022

any news on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

priceLocale | Apple Developer Documentation
Instance Property. priceLocale. The locale used to format the price of the product. iOS 3.0+ iPadOS 3.0+ macOS 10.7+ Mac Catalyst 13.1+ tvOS...
Read more >
in_app_purchase 2.0.1 | Flutter Package - Pub.dev
Exposes APIs for making in-app purchases through the App Store and Google Play. ... 0.2.1 #. iOS: Add currencyCode to priceLocale on productDetails....
Read more >
Product Data Objects - Nami Docs
productIdentifier , a product base price, and a price locale to understand the currency of the price. See the Apple iOS SDK documentation...
Read more >
packages/in_app_purchase/CHANGELOG.md
0.3.4+6. iOS: Fix the bug that prevent restored subscription transactions from being completed ... Expose SKError code to client apps.
Read more >
Apple Seeds Second Betas of iOS 16 and iPadOS 16 to ...
Apple today seeded the second betas of upcoming iOS 16 and iPadOS 16 updates to ... A property priceLocale is included in Product....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found