Skip to main content
Question

Best Practices for Managing Consumable Tokens with RevenueCat

  • February 14, 2025
  • 1 reply
  • 25 views

Forum|alt.badge.img

Hi,

I have two options in my mobile app: a subscription that includes access to all features and also grants an amount of tokens, and consumable tokens that only provide tokens.

I understand that it’s best to manage the token balance in my backend. However, I want to ensure that if a user makes a restore, I can link them to the token balance I store in my backend and restore the correct amount of tokens (for example, if a user reinstalls the app or performs a factory reset, they get a new user ID, and I want the restore process to link them back to their old ID and token balance).

I don’t have an authentication system, so I can’t rely on user login to track purchases.

Alternatively, can I update the user’s token balance as they purchase and spend tokens using RevenueCat’s customer attributes? Then, when they restore purchases, can I retrieve this balance and update their token count accordingly?

So what is the best practice to implement my case, and how should I structure it?

Thanks!

This post has been closed for comments

1 reply

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 516 replies
  • February 18, 2025

Unfortunately consumables can only be restored by using an account system with custom App User IDs due to these types of in-app purchases not showing up on the underlying store receipt after the transaction is finished, see our docs here. So unless you have an authentication system it will be difficult to keep track of this.
 
You could use RevenueCat's customer attributes as when using anonymous app user ids these should alias together when restoring, but we recommend against this incase somehow your users figure out how to access and set the subscriber attributes. To avoid such a case, it is recommend to instead store and keep track of this on your backend.


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