2

We are trying to use Apple's subscription status url.

We have setup our server to accept the url we provided in the app page and made sure the server is compatible with ATS requirements. A post test with Postman works. (we see the request and a test json received on our end)

However we are still not receiving any notifications updates from Apple upon renewal (not even initial_buy).

Seen some questions from last year but no valid solution. Does anyone had this problem lately and solved it?

giorashc
  • 13,691
  • 3
  • 35
  • 71

2 Answers2

1

I can't make a comment, and it's hard to see if this is the case here without knowing if you are actually receiving NOTHING at your script, or just receiving no data in $_POST.

If the latter, this should work:

$data = file_get_contents('php://input');

Then you should be able to work with the data by calling json_decode or doing whatever you want with it.

1

I ran into the same problem. I thought that Apple would call our webhook whenever a new subscription charge is processed (similar to how Paypal, Stripe, Android etc work). But that's a mistake. According to this technical note:

https://developer.apple.com/library/archive/technotes/tn2413/_index.html#//apple_ref/doc/uid/DTS40016228-CH1-SUBSCRIPTIONS-MY_SERVER_PROCESS_RARELY_RECEIVES_RENEWAL_NOTICES_WHEN_THE_AUTO_RENEWING_SUBSCRIPTION_RENEWS_

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.

So Apple will only notify this endpoint when

  • a new subscription is created (at least that's the case for us, but we have a trial offer)
  • the subscription status changes from active to expired, or vice-versa.

So you have to keep track of the subscription receipts when the customer signs up. When the subscription is about to expire/has expired, call Apple's receipt validation endpoint to fetch the new receipt. If the receipt says the subscription expired, your webhook should be notified when the user reactivates it.

David Chatenay
  • 326
  • 2
  • 10