In-app purchase tutorial

I am sorry, took me a lot longer than expected. The display of my MacBook passed out and it’s now with Apple for the next three weeks so I had to find a replacement. Thank God for our awesome neighbors.

This is the code I am using. It crashes in the simulator but it works on a device. Most (if not all) of the code and comments are from @Ryan_Hartz IAP tutorial. Just reshuffled some of the stuff. The sample project also has some of @Jason_King and @Jeremie_L extensions.

This is what you have to do to make it work:

  1. Make sure to replace the values in the productID with your company name, app name and IAP name everywhere in the code.

com.ReplaceWithCompanyName.ReplaceWithAppName.ReplaceWithIAPName

  1. The same values have to show in the bundle identifier in the iOS settings.

com.ReplaceWithCompanyName.ReplaceWithAppName

  1. Make sure to activate In App Purchase in the iOS build settings. It is activated in the sample project but if you copy the code to your project, it might not be.

https://www.amazon.de/clouddrive/share/R22IyELIQOVQrWm4gDBHmRRALQFyUoaml4yw3UuOlct

4 Likes