Skip to main content
Solved

Getting products without offerings, sdk needs an upgrade


Forum|alt.badge.img+1

Hi guys,

I'm configuring all products for my app. I have all of them imported from google play and my entitlements configured.
In the docs you say that offerings are optional, but that's not true, because the sdk can't get product data without offerings and packages. I'm using unity sdk.

What's the point of this?
 

If I already have the products, I should be able to get all the data of each specific product, even if I don't have any offering.
But right now, for me to get the products data and display them on muy app, I have to create an offering and a package for each product. And to be honest that's horrible, because I'm just duplicating products into packages for no reason at all, and also because the UI to attach products to packages it's very very bad, specially if you have lot's of products.

So, is there in the roadmap and update to fix this?
If not, at least update your documentation that you HAVE to have products, offerings and packages for revenuecat to work at it should.

Thanks!

Best answer by toni-rico

Hi @Ivan LC, have you tried the GetProducts and PurchaseProduct functions in Purchases?

The first one allows you to get the information for a product by using the product id. The second one, allows you to purchase a product using the product id.

For example, the PurchaseProduct function can be used like this:

purchases.PurchaseProduct(
   "your_product_id", 
   (productIdentifier, customerInfo, userCancelled, error) =>
        {
            handlePurchaseCompletion(customerInfo, userCancelled, error);
        }, 
   "subs" // Use inapp if you're not purchasing a subscription
);

Let me know if that doesn’t solve your issue or if you have other questions.

View original
Did this post help you find an answer to your question?

5 replies

Forum|alt.badge.img+3
  • RevenueCat Staff
  • 55 replies
  • Answer
  • October 2, 2023

Hi @Ivan LC, have you tried the GetProducts and PurchaseProduct functions in Purchases?

The first one allows you to get the information for a product by using the product id. The second one, allows you to purchase a product using the product id.

For example, the PurchaseProduct function can be used like this:

purchases.PurchaseProduct(
   "your_product_id", 
   (productIdentifier, customerInfo, userCancelled, error) =>
        {
            handlePurchaseCompletion(customerInfo, userCancelled, error);
        }, 
   "subs" // Use inapp if you're not purchasing a subscription
);

Let me know if that doesn’t solve your issue or if you have other questions.


Forum|alt.badge.img+1
  • Author
  • New Member
  • 2 replies
  • October 2, 2023

Hi @toni-rico

Yes I did. PurchaseProduct works fine, but GetProducts always returns an empty array, doesn't matter if I pass "subs" or "inapp".
Here is a discussion about GetProducts and I can't get it to work either :(.


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 55 replies
  • October 2, 2023

Hi @Ivan LC, can you add a small code sample of how you’re calling `GetProducts`? Also sending logs would be helpful in order to diagnose this issue.

Let me know if you need any help with that in the meantime!


Forum|alt.badge.img+1
  • Author
  • New Member
  • 2 replies
  • October 3, 2023

Hi @toni-rico, I was just doing some test to send you the logs and the code, and I figured it out!

What was happening is, in my 'Purchases' product identifiers I had both in-app purchases and subscriptions, and that's why my 'GetProducts' was always returning 0.

I tested only with in-app purchases ids and calling 'GetProducts' with the 'inapp' parameter and it works.
Also only with subscription ids calling 'GetProducts' with the 'subs' parameter and it works too.

So if you mix both, it doesn't return anything instead of returning only the ids that works. And if one of those ids is wrong, it will return 0 products too.

Anyway it works. Thanks!


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 55 replies
  • October 3, 2023

Ahh makes sense thanks for reporting the result! And glad that you got it working πŸ™Œ


Reply


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