Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the react-native-iap support localised title? #2458

Open
cervebar opened this issue Jun 14, 2023 · 2 comments
Open

Does the react-native-iap support localised title? #2458

cervebar opened this issue Jun 14, 2023 · 2 comments

Comments

@cervebar
Copy link
Contributor

cervebar commented Jun 14, 2023

Description

We have localized iap products (very likely) correctly defined in Google Play and in App Store. In code we are using change language feature (via i18n) is there anyhow possible to retrieve localised title/name of products?

Expected
someting like:

const products = await getProducts({skus: productIds})
const locTitle = products[0].localisedTitle

Environment:

  • react-native-iap: any version
  • react-native: 0.68
  • Platforms (iOS, Android, emulator, simulator, device): iOS, Android

To Reproduce

const products = await getProducts({skus: productIds})
console.log(products)

@professorkolik
Copy link
Contributor

As far as I can say it will take languages which are set to user AppStore/PlayStore

Based on docs Product contains

title => Returns the title Android and localizedTitle on iOS.
description => Returns the localized description on Android and iOS.

If you wanna show based on user settings localization, then you should handle it on your end

@MTPL0005-AbhishekDube
Copy link

Yes, it returns the localized price for iOS and Android, but the key that produces the localized price differs.
for iOS --> sub.localizedPrice will give the localized price,
for Android --> sub.subscriptionOfferDetails[0].pricingPhases.pricingPhaseList[0].formattedPrice

here "sub" stores the data returned by IAP.getSubscriptions

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

No branches or pull requests

3 participants