Skip to main content
Solved

[EXPO] Why does Purchases.getOfferings() return item but Purchases.getProducts() returns empty array

  • 14 May 2022
  • 1 reply
  • 223 views

Im wondering why is it that i retrieve data back from “getOfferings” but not "getProducts”. I’d imagine that the fact that im receiving data for “getOfferings” means my current setup is correct. Any insight on this? Is there something more needed for “getProducts” to work?

Info​​​​​​

  • Expo SDK 44
  • react-native-purchases 4.5.3
  • Observed on iOS
// Example response: await Purchases.getOfferings().allP'Default']
{"availablePackages": <{"identifier": "$rc_lifetime", "offeringIdentifier": "Default", "packageType": "LIFETIME", "product": pObject]}], "identifier": "Default", "lifetime": {"identifier": "$rc_lifetime", "offeringIdentifier": "Default", "packageType": "LIFETIME", "product": {"currency_code": "USD", "description": "Anime themed game deck!", "discounts": dArray], "identifier": "AnimeYouShouldKnow", "introPrice": null, "intro_price": null, "intro_price_cycles": null, "intro_price_period": null, "intro_price_period_number_of_units": null, "intro_price_period_unit": null, "intro_price_string": null, "price": 0.9900000095367432, "price_string": "$0.99", "title": "Anime You Should Know"}}, "serverDescription": "All decks available for purchase"}

// Example response: await Purchases.getProducts()
u]

 

1 reply

Badge +2

UPDATE: 

Yea this was my own fault, i didnt read the arguments list. You need an array of bundleIds for the function to return items back:

Purchases.getProducts([‘bundleId1’])

 

That was the issue. So word of advice to folks, look at the sdk docs

Reply