Skip to main content
Answer

Checking Subscription Status with Google promo-code

  • October 29, 2024
  • 1 reply
  • 60 views

Forum|alt.badge.img+3

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.

This post has been closed for comments

1 reply

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 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.