Solved

How to information from EntitlementInfo object in React Native

  • 20 January 2022
  • 1 reply
  • 95 views

Badge +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 

icon

Best answer by sundeep 8 February 2022, 00:07

View original

1 reply

Userlevel 3
Badge +8

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 

Reply