Home How to detect if user cancel auto-renewable subscriptions during the free trial period?
Reply: 2

How to detect if user cancel auto-renewable subscriptions during the free trial period?

user523234
1#
user523234 Published in 2016-10-26 20:15:24Z

Apple's document does not seem to mention this. So if user cancels an auto-renewable subscription purchased during the free trial period, how do we detect?

In appstore receipt JSON there is this field: is_trial_period. But I think this is for indication of whether the free trial period is over.

The only thing I can think of is this NSBundle.mainBundle().appStoreReceiptURL?.path and if this is nil than that will indicate the user has not subscribed or cancel within the free trial period. But for sandbox testing, there is no way to do a cancel during free trial period to test this scenario.

Does anyone have a solid knowledge of this?

Paulw11
2#
Paulw11 Reply to 2017-03-28 19:49:31Z

In order to support auto-renewing subscriptions, your app needs to periodically submit the app receipt obtained from NSBundle.mainBundle().appStoreReceiptURL?.path to Apple's receipt validation service.

Contained in the JSON response from this service is the latest_receipt_info array.

By examining this array you will be able to determine the currently active subscription(s).

If a user turns off auto-renewal before the expiration of the free trial then latest_receipt_info won't contain a purchase with an expires_date after the free trial end date

This means, that strictly speaking, you can't "detect a cancellation" as there is no "cancellation"; there just isn't a renewal at the end of the free trial period.

Manuel
3#
Manuel Reply to 2017-10-15 08:42:47Z

This is possible with the web hook feature in iTunes Connect.

When you set a path for the Subscription Status URL of your app the App Store server will call that URL when the subscription status changes.

Currently the following key events will trigger the call:

  • INITIAL_BUY Initial purchase of the subscription.
  • CANCEL Subscription was canceled by Apple customer support.
  • RENEWAL Automatic renewal was successful for an expired subscription.
  • INTERACTIVE_RENEWAL Customer renewed a subscription interactively after it lapsed, either by using your app’s interface or on the App Store in account settings.
  • DID_CHANGE_RENEWAL_PREFERENCE Customer changed the plan that takes affect at the next subscription renewal.

More can be found here and here.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312329 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO