I am having a subscription in-app in my app.
In the test API(using Amazon Test Client), once I cancel my subscription, how do I know if the subscription has been cancelled?
Let me describe my workflow a bit :
1.User clicks on subscription and buys it(sandbox mode).
2.Corona’s store API gets triggered. I get the receipt and userId from the event in store listener.
3.I add this receipt and userId to a database in my server.
4.Whenever the user starts the app, the app tries to check the validity of the subscription in my server; a script in my server validates the subscription using the receipt and the userId (in RVSSandbox) and returns its validity
Now I am going to cancel my subscription. I go to Amazon Test Client, go to Active Transactions, and cancel my subscription there.
When my app contacts my server, the server still says the subscription is valid.
This is what Amazon’s docs say
Subscription Check (cancelled) Make a successful purchase of a subscription SKU Ensure the transaction is listed in the "Active Transactions" Page Tap "Cancel" on the subscription transaction Call initiatePurchaseUpdatesRequest, process in onPurchaseUpdatesResponse From the returned receipts, Find the most recent receipt (by start date) for that SKU Verify that the end date has a value other than null
So apparently once a subscription is cancelled, a new receipt is generated(correct me if I am wrong please).
Will this receipt be received in the “revoked” phase in the store listener? I don’t think I am receiving one.
If yes, should I update the database in my server with this “new receipt” for future validations?
If not, how do I know that the subscription has been cancelled? Will the old receipt become invalid once the subscription’s time period expires, so that I don’t have to bother with this new receipt?
Would really appreciate some help here!