Solved

RENEWAL webhooks sent every 5 minutes and automatically cancel

  • 27 July 2021
  • 6 replies
  • 439 views

Badge +4

Hello and thanks for providing any insight.

 

I am trying to setup a webhooks to my AWS dynamodb to store all events so I can keep them as a backup.

 

I noticed that after resubscribing, multiple of the same webhook is being sent.  The only thing that changes is the transaction_id.

 

So in this case, I keep getting the same type “RENEWAL” webhooks every 5 or so minutes.  Most recently I counted 7 webhooks including the last one which was type “CANCELLATION” before they stopped.  Is there anything I missed?  Is it because it is in a Sandbox environment that I get multiple renewal actions from Apple?

 

All webhooks are getting the correct response code 200 and there is a green check mark next to them.

icon

Best answer by sundeep 29 July 2021, 01:30

View original

6 replies

Badge +4

After looking into this a bit further, it seems like every time I call getPurchaserInfo(), if it has been more than 5 minutes, it will actually update the subscription and will send another webhook event.

Userlevel 3
Badge +8

Hi Adam!
 

multiple of the same webhook is being sent.  The only thing that changes is the transaction_id. 

They aren’t the same if the transaction_id is changing. The expiration and purchase time stamps should also be different from each other. The events shouldn’t be the exact same event, but some will be of the same type (e.g. RENEWAL type - see our docs here for other possible types).

 

 Is it because it is in a Sandbox environment that I get multiple renewal actions from Apple?

Correct! To make it easier to test auto-renewing subscriptions, you get renewals every few minutes. We have a guide that shows this breakdown (and also gives other great pointers on iOS testing), but you can also see it here on the Apple docs (expand “Testing auto-renewable subscriptions”):

Actual Duration

Test Duration

1 week

3 minutes

1 month

5 minutes

2 months

10 minutes

3 months

15 minutes

6 months

30 minutes

1 year

1 hour

 

These durations are controlled by Apple, so you can’t change them yourself.

 

I counted 7 webhooks including the last one which was type “CANCELLATION” before they stopped. 

After several renewals, the subscription will stop renewing, so this is normal.

The renewals happen automatically, whether the app is open or not, so it shouldn’t have anything to do with calling `getPurchaserInfo`.

Badge +4

Thank you so much for the info!  It is much appreciated and solves my last step before going live!  Thanks again!!

Badge +4

Hi

After looking into this a bit further, it seems like every time I call getPurchaserInfo(), if it has been more than 5 minutes, it will actually update the subscription and will send another webhook event.

 

I have exactly the same behaviour, it’s the call getPurchaserInfo() that sends another webhook, do you have an idea?

 

Thanks

Badge +3

any solutions

Same issue here. Every time the app loads and I check subscriptions using:

const customerInfo = await Purchases.getCustomerInfo();

This seems to trigger a renewal. This is not helpful when I want to keep retesting the full flow of subscribing. 

Please advise on this. Thanks

Reply