Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Never Get RENEWAL Notification Type on Apple statusUpdateNotification

I created an API to be called by Apple webhook to work with subscription. I've set the API url in Itunes to be called by the webhook.

According to Apple help site https://help.apple.com/app-store-connect/#/dev7e89e149d in regards to the Testing Auto-Renewable Subscription, when testing auto renewable subscriptions in the test environment, the Apple webhook will make a call to the API after 5 minutes if I select 1 month subscription duration.

But the thing is, after making first purchase, apple webhook doesn't follow up call to the API that I created to renew the subs. Even after I waited for more than 5 minutes. So I can't do any processing from the API to renew user subs in the database.

Is there some configuration that I had to make in order to test the auto renew and make apple webhook call the API to renew the sub?

like image 670
muhihsan Avatar asked Jan 01 '18 12:01

muhihsan


People also ask

Does Apple send subscription reminders?

Apple sends you email receipts every time a subscription renews—not ahead of time as a reminder, but after the fact like a normal purchase receipt. If you have a number of monthly subscriptions, it can quickly get out of hand.

What is Apple Premium automatic renewal?

A subscriber can access your subscription for free for a specific duration — for example, a one-month free offer for a subscription with a standard renewal price of $4.99 per month. Their subscription begins immediately, but they won't be billed until the offer duration ends.

How do I check app store server notifications?

Testing your server setup To determine whether your server is receiving notifications, call the Request a Test Notification endpoint in the App Store Server API to ask the App Store server to send a notification with the notificationType TEST .


2 Answers

We've found that Apple's subscription update webook calls are rather unreliable.

Based on experience:

  1. Don't count on Apple to notify you of renewals. The notification may arrive arbitrarily late (often leaving a "gap" in time), or not at all. We've resorted to retaining and retrying the original iTunes-provided receipt to revalidate renewals at the end of subscription periods --the expiration dates will change to account for the renewal.
  2. Don't count on Apple to notify you of cancellations, either. Same as above, calculate subscription duration, and retry receipts at the end of a period (the expiration date will NOT be updated if the subscription is cancelled).

Generally, this involves mapping the additional transactions/in_apps that are returned with the retried receipt to the original_transaction_id --and updating the expires_at accordingly on your end.

Hope this helps!

like image 151
ericpeters0n Avatar answered Sep 18 '22 14:09

ericpeters0n


Update: In WWDC2020 Apple announced that they add a new notification type called DID_RENEW which will be sent after any successful auto-renew. More info on that in this video, starting at around 16:00.

Original answer:

I can't find the page you linked to, however this page may shed light on the subject (emphasis by me):

The App Store attempts to charge the user account 24 hours before an auto-renewing subscription expires. If the renewal is successful, there is no server-to server notification because the auto-renewing subscription did not enter into the expired state. However, in the few cases that iTunes is unable to renew the subscription (generally there was a connection problem with the credit card server) and the auto-renewing subscription is not renewed before the expiration_date passes, the auto-renewing subscription is technically considered expired. iTunes may continue to attempt to renew the subscription. If iTunes is successful, then the RENEWAL event is sent.

Meaning, you're not supposed to receive notifications for renewals, but only for cases where the subscription became expired and only then renewed. This might be the case for sandbox renewals as well.

like image 26
byohay Avatar answered Sep 22 '22 14:09

byohay