Solved

Call to Purchases.shared.getProducts(["my_product_id"]) is returning 0 - can someone help?


Badge

Hi,

I’ve setup my App Store Connect with a test product and added to RevenueCat too. Also installed the latest version of RevenueCat in my iOS app - now I’m trying to do a test subscription purchase on a physical device from within my app but hitting a problem.

I see all the initialisation debug messages from RevenueCat in the XCode debug window - however, when I’m making the call to Purchases.shared.getProducts([“my_product_id”]), RevenueCat is not returning any product back. 

The SwiftUI code I’m using is pretty much exactly the same as posted by @Michael Eovine  in his post from a few weeks ago @ 

 

Note: I was hoping the RevenueCat documentation would help provide some useful details but surprisingly there’s only one single mention of ‘getProducts’ (see https://docs.revenuecat.com/docs/ios-native-3x-to-4x-migration#api-changes-1) and it’s in the context of it replacing the ‘products’ call. 

Can someone from the RevenueCat support team please assist in either suggesting troubleshooting steps which would identify the root cause of the issue, or helping to directly debug the issue so that we can get RevenueCat hooked up correctly?  

 

Thanks,

John

icon

Best answer by ryan 22 June 2022, 20:27

View original

4 replies

Userlevel 5
Badge +9

Hey @JohnC!

If your products, offerings, or packages are empty it's most likely related to a configuration or setup issue in Apple. We've put together a handy guide here that outlines the common reasons for this here: https://community.revenuecat.com/sdks-51/why-are-offerings-or-products-empty-124 


Apple recently updated their Paid Applications Agreement so you should double check you’ve signed the latest copy - that’s a requirement to fetch products on their end.

 

Searching the ‘Empty Products’ tag here may lead you to some other helpful solutions if that doesn’t do it: https://community.revenuecat.com/search?q=Empty+Products&search_type=tag

Badge

Thanks for the reply @ryan - appreciate the help. 

 

Just on the Paid Applications Agreement - might you have any more info on the requirement here which might affect the fetching of product data by RevenueCat?  I ask as my Paid Apps agreement is currently in Status=Pending User Info (I agreed to it but need to setup additional stuff like bank account, etc.)

Just curious if that ‘Pending User Info’ status should be enough to allow the product query to work, or if it has to be Status=Active?  

Thanks again,

J.

Userlevel 5
Badge +9

Hey @JohnC!

You’ll need the status to be Active before products can be fetched. The requirement is on Apple’s end, nothing to do with RevenueCat in particular - products can only be fetched from Apple or Google directly and this is just a wonky requirement on Apples end. 

https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/fetching_product_information_from_the_app_store/

 

 

Badge

Ok, that’s very helpful info - thanks again @ryan - when my product is Status=Active, I’ll test my code again. 

One suggestion for an improvement in RevenueCat (assuming you can derive this info from the call to the Appstore) would be to add a debug output to indicate that the status is not active on the target product. This would be very helpful from a developer’s perspective to help troubleshoot such issues. 

Cheers,

J.

Reply