Skip to main content
Solved

Consumables IAPs

  • 10 October 2024
  • 1 reply
  • 44 views

Forum|alt.badge.img+7
  • Helper
  • 5 replies

We’ve implemented consumables as an add-on along side our subscription. The high-level flow is: user makes purchase in-app —> RC sends webhook —> we increment the user’s balance in our database.

How should a consumable purchase be validated locally.

After receiving the CustomerInfo object in the purchase completion handler, what do I specifically look for? With subscriptions or non-consumables I just check to see if the entitlement is present. Consumables obviously don’t require permanent entitlements.

I can filter the object’s nonSubscriptions array for the correct productIdentifier, and then check if its purchaseDate is less than 30 seconds old.

This feels brittle—for example, somebody could easily make a purchase of the consumable and then quickly attempt it again and the code above would consider them having purchased it twice.

Thoughts on this? Should I just show a loading animation and query my database here instead?

 

[edited to remove second question because I found the answer here]

 

 

Best answer by wes_clark

Hi! We would recommend using the method of checking your database in this case. Here is another community post where we breakdown our recommendation further: 

 

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

1 reply

wes_clark
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 220 replies
  • Answer
  • October 15, 2024

Hi! We would recommend using the method of checking your database in this case. Here is another community post where we breakdown our recommendation further: 

 


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