Trouble Migrating Subscription System to Amazon IAP with Remote Database Sync

Hello,

I’m currently working on migrating my IPTV app’s subscription system from a basic local check to Amazon In-App Purchasing (IAP) for Fire TV. The goal is to verify the subscription status through Amazon IAP and store that data (including device serial, subscription start date, and expiration) in a remote MySQL database via a PHP API.

So far, I’ve implemented:

  • Integration with com.amazon.device.iap SDK in my MainActivity.kt
  • A Flutter method channel to call getSubscriptionInfo() and handle purchase receipts
  • Server-side PHP scripts (registrar_instalacion.php and actualizar_suscripcion.php) to register the installation and sync subscription info

However, the subscription status is not being restored properly after app restarts or reinstallations. Despite having an active subscription, the app always returns restored: false, and the backend never receives updated subscription data.

Also, I’m calling getPurchaseUpdates(true) to trigger receipt restoration, but it seems either the purchase data isn’t being returned, or the method channel isn’t capturing it correctly. I’ve confirmed that subscriptions are active on Amazon’s side.

My questions:

  1. Is there a reliable way to ensure Amazon IAP subscriptions are restored on app launch, especially for auto-renewable items?
  2. How can I extract and forward the original subscription date and expiry from Amazon’s receipt to my backend?
  3. Are there any known issues or extra steps needed to support receipt verification (RVS) in production for Fire TV apps?

Thanks in advance for any help or suggestions. I’d be happy to share code or logs if needed.

Hi,

Thanks for posting. We have messaged the appropriate team for further investigation and will let you know once we receive an update.

Hi Vichier,

Welcome to the Forum, and thank you for posting!

  1. getPurchaseUpdates() is the reliable way to ensure Amazon IAP subscriptions are restored on app launch. getPurchaseUpdates(false) would provide receipts whenever there is an update to the receipt after last invocation. getPurchaseUpdates(true) would return all receipts (including active and cancelled subscriptions) on each invocation irrespective of changes to receipt. Reference - Implement Appstore SDK IAP | In-App Purchasing

  2. getPurchaseUpdates() response has purchaseDate (initial subscription purchase date) and cancelDate (date by which subscription got expired), which developers can forward to their back end. Alternatively, developers can retrieve this information from RVS response.

  3. This Tech doc captures the necessary setup steps for RVS.

I hope that answers your questions.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.