Skip to main content

Hi,

I am trying to fetch APP Store IAP products using the API Purchases.getProducts, however, it is returning no products. After looking at various post it seems that I need to pass second argument to the method Purchases.getProducts as the default value is “subscription” and my product is not Subscription.

I am struggling to pass the second argument which is ENUM in the latest SDK and not a simple string like “sub” or “iap”. I don’t know how to import these enum values so that I can use it as argument in the function call.

Could you please help me with some sample code to pass the second argument?

 

Thanks in advance.

 

Thanks,

Kapil

I am able to solve this problem now. Below is a summary of what I did to get Android products successfully. Ideally, these should be included in the  checklist as I spent more than two weeks to identify all possible issues while fetching Android IAP products.

 

  1. Not publishing to Closed Track and getting approval from Google
  2. Not using Google specific API key
  3. Not providing a second argument to get Products. This works well for iOS so thought that it will be working for Android also but that is not the case.

 

import PRODUCT_CATEGORY from 'react-native-purchases';

await Purchases.getProducts(profileArray, PRODUCT_CATEGORY.PRODUCT_CATEGORY.NON_SUBSCRIPTION);


Hi @kapil-mahajan-e35a61,

I am glad you got it working and thank you for the feedback, I am updating the checklist with your points.