Question

I am looking to build a ios application that will use an auto-renewable subscription on a monthly biases. We will be using some VOIP features that we will be charged monthly for. My question is, how can we be notified when a user cancels a subscription in IOS, so that we can cancel the users VOIP telephone number with our provider.

Was it helpful?

Solution

You will need to verify the receipt the same way you do for regular In App Purchases, but obviously you will do this every time the subscription period expires. Check out the documentation on this, Verifying an Auto-renewable Subscription Receipt

So based on this, it appears you will need to setup your server to check for a valid subscription every month (cron job?). This will allow you to cancel the VOIP number in your system if the subscription is no longer valid. Your app would be responsible for verifying a subscription is still valid when it is opened or the user attempts to access features that require a subscription.

Updated For Comment

The sandbox is supposed to return expiration dates in the following scheme.

enter image description here

This is from page 164 of the iTunes Connect Developer Guide

If it is not working this way you may want to file a bug report.

OTHER TIPS

Also, please not the following from Apples IAP doc:

Additionally, a sandbox subscription will only autorenew a maximum of 6 times. After the subscription has auto-renewed 6 times, it will no longer renew in the sandbox.

As mentioned above, you need to have the server-side receipt validation. You can check Apple's documentation here. It's not enough just to check the subscription status at the end of the subscription period as users may refund subscriptions by contacting Apple. You need to catch refunds on your server. You can use Apple's server-to-server notifications for that. Also, there are a number of other corner cases including subscription upgrades. Building a subscription validation server is a complex task, so you may want to use a third-party service for that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top