react-nativereact-native-iap

How to get localised names from react-native-iap


We have localized iap products (very likely) correctly defined in Google Play and in App Store, but this code will not give us the localized titles of products. Should we configure something else? Or call some different method or add any options there? How do you localize your product names? Any tips are welcomed 🙏🏻.

code:

import {
  getProducts
} from 'react-native-iap'
...
const productIds =['productid12345']
const products = await getProducts({skus: productIds})
console.log(products)

response:

{
      "description":"Some description in english :(",
      "name":"English name :(",
      "oneTimePurchaseOfferDetails":{
         "formattedPrice":"100,00 Kč",
         "priceAmountMicros":"100000000",
         "priceCurrencyCode":"CZK"
      },
      "productId":"my.product.id.12345",
      "productType":"inapp",
      "title":"title only in English :("
   },

Definitions in stores: enter image description here enter image description here


Solution

  • Ok, so it works like this:

    See this answer from react-native-iap library contributor: https://github.com/dooboolab-community/react-native-iap/issues/2458.