Skip to main content

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]

 

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