Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Webhook / Notification for Recurring Payment for AutoRenewable Subscriptions

Tags:

ios

Is there a notification that iOS sends for autorenewable subscriptions when a recurring payment is processed and the subscription is extended? Is that what the RENEWAL webhook should be interpreted as?

like image 869
Say.My.Name. Avatar asked Jan 21 '18 21:01

Say.My.Name.


2 Answers

I spoke to an Apple representative and they said that Apple only sends the notifications for the initial purchase. Subsequent renewals must be polled like a normal transaction.

RENEWAL is actually sent when there "is a lapse in service and a recovery by Apple's billing Retry Product."

This is the real answer and it is found NO WHERE on Apple's documentation. I hope this helps other people.

like image 79
Say.My.Name. Avatar answered Sep 23 '22 14:09

Say.My.Name.


This what the documentation says:

Status Update Notifications

A statusUpdateNotification is a server-to-server notification service for auto-renewable subscriptions. A notification specifies the status of a subscription at the time the notification is sent.

To obtain up-to-date information as you process events, your app should verify the latest receipt with the App Store. It is recommended that you use the status update notification service along with receipt validation to validate a user’s current subscription status and provide them with service. See Receipt Validation Programming Guide for information about receipt validation.

To receive status update notifications, configure a subscription status URL for your app in iTunes Connect. The App Store will deliver JSON objects via an HTTP POST to your server for the key subscription events listed in Table 6-3. Your server is responsible for parsing, interpreting, and responding to all statusUpdateNotification posts.

It then continues below listing the conditions for a notification:

  • INITIAL_BUY Initial purchase of the subscription. Store the latest_receipt on your server as a token to verify the user’s subscription status at any time, by validating it with the App Store.

  • CANCEL Subscription was canceled by Apple customer support. Check Cancellation Date to know the date and time when the subscription was canceled.

  • RENEWAL Automatic renewal was successful for an expired subscription. Check Subscription Expiration Date to determine the next renewal date and time.
  • 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. Service is made available immediately.
  • DID_CHANGE_RENEWAL_PREFERENCE Customer changed the plan that takes affect at the next subscription renewal. Current active plan is not affected.

So to answer you question: Yes, successful renewal means that Apple received the payment of your user (and that you will also be paid).

However, it's not sent to iOS but only to a server. You need to register a URL with Apple on which they will then POST these notifications. Your server and iOS app instance must then talk via your web API to get the app notified.

like image 20
meaning-matters Avatar answered Sep 23 '22 14:09

meaning-matters