## Android webhook - Workflow: - [Setup pubsub + webhook](https://developer.android.com/google/play/billing/getting-ready#configure-rtdn) - When someone buys make sure to set `applicationUserName` in the [in_app_purchases package](https://pub.dev/documentation/in_app_purchase/latest/in_app_purchase/PurchaseParam-class.html) - this'll set the backend I think. it'll set the [obfuscatedExternalAccountId](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products#ProductPurchase) - When it is triggered it either makes call to: - https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/get - https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/get - Also make sure that it is a real payload. Maybe the call to the api makes sure that it is good. so no need to do that! - Resources - realtime ref: https://developer.android.com/google/play/billing/rtdn-reference - setup guide with pubsub: https://developer.android.com/google/play/billing/getting-ready#configure-rtdn - will use product id from stripe ## Apple Webhook - See how I did it for Fleeting Notes! - https://github.com/fleetingnotes/supabase-functions/blob/main/supabase/functions/app-store-webhooks/index.ts