Skip to main content
Solved

Getting "NON_SUBSCRIPTION" products


Forum|alt.badge.img+1

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

Best answer by kapil-mahajan-e35a61

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);

View original
Did this post help you find an answer to your question?
This post has been closed for comments

2 replies

Forum|alt.badge.img+1

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);


sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • April 16, 2024

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings