Skip to main content

I need to display the subscriptionPeriod and the price of the currently active subscription directly within the app.

My app uses anonymous user IDs (no login or authentication), and I don’t have a backend server involved.

What is the best way to retrieve and display this information using the RevenueCat React Native SDK?

Hi,

Given that you do not have a backend/server, you’d have to call RC’s RestAPi and send their anonymous ID to retrieve the details of that subscription from your client/front-end.

Alternatively, you could use device-info, get the device-id of the user, then, use that to pass into the config. Store that device ID in local storage, then, use that in the account section and pull the local-storage and use a useEffect to set a useState then send that to their Rest API to get the users sub details.


Hi, you can use getProducts to get the product and from there can access these values via the price and subscriptionPeriod fields:

https://revenuecat.github.io/react-native-purchases-docs/8.11.7/classes/default.html#getProducts

https://revenuecat.github.io/react-native-purchases-docs/8.11.7/interfaces/PurchasesStoreProduct.html


Reply