iosjsonobjective-cin-app-purchase

How do I know if a user cancels an auto renewing subscription with In-App Purchases on iOS?


I have been testing out Apple's In-App Purchases (sandbox mode) which is great for testing what happens when a user subscribes, but how do I tell if the user is still paying? How do I know if the subscription has been canceled? Apple doesn't appear to let me test that out?

I see that there is something about verifying receipts? How can I do this?


Solution

  • When you subscribe a auto-renewable subscription from app, you will get a receipt. Send that receipt to your server and your sever can use that receipt to verify if your purchase is valid from iTune store (check their doc)

    You will get a JSON response and some field inside can show you the expired date. As to user's cancel, sorry, you cannot know that until current period expire (actually you will know that 24 hours before expiration due to apple store's mechanism)

    Hope this helps.

    [Updated @ 2017/11/5]

    Now Auto-renewable subscription is allowed to notify your sever when new period begins. Please check latest document.