Skip to main content
Solved

Checking Subscription Status with Google promo-code

  • October 29, 2024
  • 1 reply
  • 33 views

Forum|alt.badge.img+1

In the documentation for checking subscription status, it is said that for checking if a user has paid, we need to use the entitlement object like this:

if (Object.entries(customerInfo.entitlements.active).length) {
  //user has access to some entitlement
}

However, this doesn’t work when a user has used a promo-code on Android. Instead we use:

if (Object.entries(customerInfo.activeSubscriptions).length) {
//user has access to some entitlement
}

Is that a correct way to check?

Best answer by kaitlin

Hi @soscuisine,

You can use the customerInfo in whatever way works best for your app! In the documentation, we specifically show an example for checking if entitlements are active but if you’d prefer to check for active subscriptions, that should work as well.

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

1 reply

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 365 replies
  • Answer
  • October 31, 2024

Hi @soscuisine,

You can use the customerInfo in whatever way works best for your app! In the documentation, we specifically show an example for checking if entitlements are active but if you’d prefer to check for active subscriptions, that should work as well.


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