I am currently utilizing the RevenueCat SDK in my Flutter project to manage in-app purchases, specifically, monitoring real-time changes in users' subscription statuses. The SDK has been instrumental in achieving this on the client-side, and now, I am looking to sync this data with my backend.
In my backend (which is developed using the Elixir/Phoenix framework), I have a database table where I would like to maintain a record of whether a user is subscribed or not. The main goal is to ensure that the subscription status in my backend is always in sync with the real-time status on the client-side.
Here are my thoughts so far:
- One way could be to send the subscription status from the client to the backend every time there is a change. However, I am concerned about the reliability and timeliness of this approach.
- Another approach could be to use webhooks, but I am not entirely sure how to set this up with RevenueCat and Flutter.
I am very interested to hear if anyone has encountered a similar scenario and how you tackled it. Are there any best practices or recommended approaches for syncing the backend with the user's IAP status in a RevenueCat-Flutter setup? Your insights and experiences would be invaluable as I work towards a robust solution.
Thank you in advance for your help and guidance!