How to do "receipt validations" in Flutter?

Viewed 2439

I want to add IAPs to my existing Flutter app (my first app), so I looked into this topic for a while and I am starting to understand how it works until I came across the "receipt validation" Topic. It's difficult for me to understand the answers to questions related to this topic because I'm a relatively inexperienced programmer. If somebody could provide me a simple explanation on what actually happens during a receipt validation (on ios and android) and what the app developers part of the process is, it would help me a lot. I am using the flutter_inapp_purchase plugin.

1 Answers

Receipt validation involves taking the local receipt file and sending it to your server, from there your server will securely validate the receipt with either Apple or Google. Your app then receives a "success" or "failure" response depending on if the validation succeeded.

So the Flutter portion would be to extract the receipt and POST it to your backend. The actual receipt validation happens on your server and can be done in any language you prefer.

If you're interested in an out-of-the-box solution, we just released a beta version of a Flutter plugin that includes server-side receipt validation: https://pub.dev/packages/purchases_flutter/

Update: The Flutter plugin mentioned above is stable and has been out of beta for a while now.

Related