In-App Purchases: Auto-Renewable Subscriptions Tutorial

how should i track in server to server status updates? like server-to-server response include latest_receipt, enviroment, original_transaction_id and so on, so here how will i know which user the current notification belongs to?

This is how I imagine it working…

Receipt Upload


Thank you so much, but this is for Apple Validation Api, how will i manage Server-To-Server Status Updates? That include these attached fields, how will i know this specific response is connected to my user?

Great tutorial indeed. I am new to iOS and have one question regarding the auto-renewable subscriptions. Here is the scenario:

  • App doesn’t require any login from user
  • User just subscribed to the App for monthly package to view the content
  • After first month user automatically gets charged for the next month
  • After second month, apple tries to charge the user automatically but found that there is no money in the account - transaction gets failed.

In that case when transaction gets failed, how I(application) will be notified so that we can change the status in our database for this user?


Hi Chris,

Great tutorial.

But I can’t get it to work. I replaced YOUR_ACCOUNT_SECRET in both places with my shared secret (I have tested with the master shared secret and with an app specific generated shared secret) with no luck. After subscribing to any plan I get the message “Account Secret Not Configured” when i tap on the “Subscribed? Come on in …”.

Maybe something changed in IOS 11?

Don’t replace the second “YOUR_ACCOUNT_SECRET” in the guard. That is there to let you know if you forgot to replace the first one.

Thank you very much !!! That was it.

I just wish it was in Objective-C, but will try to translate it into Obective-C.

Great tutorial !!!

RW Team, I cannot seem to get beyond the first Build and Run because of an error “‘loadReceipt’ is inaccessible due to ‘private’ protection” in the SubcriptionService.swift file…Can anyone help here?

Looks like I have eliminated that error by completing the tutorial, however, I am having trouble understanding the App Delegate code…the statement “At the top of application(_:didFinishLaunchingWithOptions:), add the following — just ignore the error for now:
Can someone send me their entire AppDelegate.swift code? Or at least specifically the section where you are adding the SKPaymentQueue.default().add(self) code?

Have you looked at the final project provided at the end of the tutorial?

Last question, my Sandbox account will not load when selecting the appropriate subscription and signing in with my Sandbox AppleID. Would there be something like two factor authentication preventing this from loading?

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]