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.

getProducts() returns only Product fields: price, currency, productId

See original GitHub issue

Version of react-native-iap

5.2.0

Version of react-native

0.63.3

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

IOS

Expected behavior

When I call getProducts() or getSubscriptions() it should return me a Product objects array with all fields described in docs similar to this

{ productId: 'com.XXX.sdk38.annual', subscriptionPeriodUnitIOS: 'YEAR', description: 'Activate Premium features on XXX', introductoryPrice: '', title: 'Annual', introductoryPriceSubscriptionPeriodIOS: '', introductoryPriceNumberOfPeriodsIOS: '', discounts: [ { localizedPrice: '€0,00', numberOfPeriods: '1', type: 'SUBSCRIPTION', identifier: 'com.XXX.sdk38.tryannual', paymentMode: 'FREETRIAL', price: '0', subscriptionPeriod: 'MONTH' } ], type: 'Do not use this. It returned sub only before', localizedPrice: '€54,99', introductoryPricePaymentModeIOS: '', price: '54.99', currency: 'EUR', subscriptionPeriodNumberIOS: '1' }

Actual behavior

When I call getProducts() or getSubscriptions() it returns me a product with only 3 fields (see attached screenshot):

  • price
  • currency
  • productId {price: "19.99", currency: "USD", productId: "hiii.premium1a"}

Tested environment (Emulator? Real Device?)

Real device. Production scheme with build configuration Debug and Debug executable set to true. But generally, we’ve noticed the same behavior on prod.

Steps to reproduce the behavior

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
TimPetricolacommented, Dec 10, 2020

I’ve had the same problem when upgrading from 5.1.1 to 5.1.3. It doesn’t affect every device/account, but we saw it happening in production for ~800 users. I could not find a specific pattern, but reverting to 5.1.1 fixed it.

0reactions
hyochancommented, Feb 7, 2021

#1246 has been released to 5.2.6. Let’s see how it goes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getProduct - Velo API Reference - Wix.com
The getProduct() function returns a Promise that is resolved when all of the information about the product shown on the ProductPage is retrieved....
Read more >
WooCommerce: Get Product Info (ID, SKU, $) From $product ...
I'm using $product->get_price() but it return price without symbol, how can I pull Symbol. I use currency switcher and try to automated short...
Read more >
Product - Shopify.dev
The Product resource lets you update and create products in a merchant's store. You can use product variants with the Product resource to...
Read more >
Products and price lists | SuperOffice Docs
You've got several variants of GetPriceList() , which all return NSPriceList[] and take the ID of a quote connection as the 1st argument....
Read more >
Get custom product attributes in Woocommerce - Stack Overflow
You can get the single value for the attribute with below code: $pa_koostis_value = get_post_meta($product->id, 'pa_koostis', true);.
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