Question

[EXPO] How to fetch products from RevenueCat? Why does Purchase.getProducts(['productId']) return empty array?

  • 18 July 2022
  • 2 replies
  • 24 views

Badge

I have created a product in google play console, and I also created a revenuecat product with the same id, but the the following line of code returns an empty array.


// Fetching all products by passing an array of their product_id
const products = await Purchases.getProducts(['product_id']);

// Printing the list of products available.
console.log(products);


// Example response:
[]

Project info:

  • Expo SDK version: 45
  • React native: 0.68.2
  • react-native-purchases: 4.6.1
  • Device tested: android

2 replies

Userlevel 4
Badge +10

Hey @kunga_tashi 

Have you had a chance to take a look at this community post?

Oftentimes when developers are having issues fetching their products, it is due to a step missing from the community post above. 

I am having the same problem. The lack of insights into the problem is driving me crazy :-)

 

Can’t RC log relevent info whenever we encounter problems like this!?

 

E.g. if I pass id’s that do not exist please state so and list the available ones.

 

I guess the api’s towards App Store and Play Store has this capability!?

 

I have tried everything (I think) now but the result is always an empty list.

Reply