Skip to main content
Answer

How to information from EntitlementInfo object in React Native

  • January 20, 2022
  • 1 reply
  • 142 views

Forum|alt.badge.img+3

Your documentation says we can access Expiration Date using EntitlementInfo but no code is given in how to call this object in React Native and I am having trouble to get this information.

-> https://docs.revenuecat.com/docs/purchaserinfo#section-get-entitlement-information 

Best answer by sundeep

Hi @Habydate,

You should be able to see two examples in our Subscription Status article for React Native: https://docs.revenuecat.com/docs/purchaserinfo#checking-if-a-user-is-subscribed 

In your example, you could access the expiration date like `purchaserInfo.entitlements.all.my_entitlement_identifier.expirationDate`

If you want to see the general structure of purchaserInfo and entitlementInfo for React Native, you can check out this file: https://github.com/RevenueCat/react-native-purchases/blob/main/src/purchaserInfo.ts#L34 

This post has been closed for comments

1 reply

sundeep
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • Answer
  • February 7, 2022

Hi @Habydate,

You should be able to see two examples in our Subscription Status article for React Native: https://docs.revenuecat.com/docs/purchaserinfo#checking-if-a-user-is-subscribed 

In your example, you could access the expiration date like `purchaserInfo.entitlements.all.my_entitlement_identifier.expirationDate`

If you want to see the general structure of purchaserInfo and entitlementInfo for React Native, you can check out this file: https://github.com/RevenueCat/react-native-purchases/blob/main/src/purchaserInfo.ts#L34