iPhone In App Purchase tutorial

Does anyone have a tutorial or step by step guide on how to set up an in app purchase system for a Unity iPhone game? As I understand it you need to make a call to native code and I've read the example on the Unity resources page, but I was wondering what solutions you guys used and if there were any store kit specific examples?

This is a good tutorial on how to implement StoreKit into your Xcode along with some working source code at the end:

http://blog.mugunthkumar.com/coding/iphone-tutorial--in-app-purchases/

Combine that with the unity native code example:

http://unity3d.com/support/resources/example-projects/iphone-examples

You can set up feature unlocks and consumables with a bit of time and considering the possible return it's worth the effort to figure it out.

EDIT:

This blog has some links to other articles that will help with displaying the store, anti-piracy measures and iTunes connect

http://www.alexcurylo.com/blog/2010/02/26/in-app-purchasing/

EDIT2:

If you have set up your xcode correctly and your purchasable products list keeps returning 0 it means you've not set up iTune connect correctly. Follow these steps and double check everything is in place:

1) Fill in a paid contract with contact details, bank account, address and tax details, every section needs to be filled in and the contract must be in the "in effect" column

2) In the provisioning portal set up your app and bundle ID to accept In App Purchases (don't use any wild cards * in the app ID)

3) Set up a new App (if it's not already for sale) you can tick the upload binary later box if it's still in development

4) There should be a module for In App Products (if not, go back and check the previous steps) Click on your App and click on add new product. Fill in all the details and upload a screenshot and click on "Cleared for Sale" and "Approve". (It wont appear in the real App Store till you upload a binary and gone through App Review)

5) Set up a test user account under manage users for in app purchases, use a fake e-mail, it doesn't matter. Don't ever log in using the test user account or validate it as it will render it useless, only ever enter the login details when prompted to in game.

Double check your product IDs in your code. Double check that you have your paid contract in place and that the in app purchases have a tick next to cleared for sale and developer approved.

6) Log out using settings > store on your device before starting the app. (doesn't work in the simulator, must be on device)

Just to by fair, here’s the OpenSource framework Soomla which provides plugins for iOS, Android, COCOS2d-X and finally with a Unity plugin :wink:

You should check out Unibill. It offers extremely simple storekit integration, plus integration with Google Play and the Amazon App Store for minimal extra effort. It’s three plugins in one!

We also offer a FREE native plugin that provides in-app purchases with Apple hosted downloads, and an easy to use API. It also mirrors the exact native StoreKit framework with 20 classes and 102 methods if you want to use advanced functionalities and customize implementation. There are examples, tutorials, and videos showing you how to use it. Some sources are available on GitHub.

Asset store link of the free U3DXT Basic: https://www.assetstore.unity3d.com/#/content/11817

Not only that, we are in the process of opening up the entire native iOS SDK to Unity. Our progress so far has GameKit, Social Networking, Face Detection, iOS 7, Speech, Game Controllers, Multipeer Connectivity, Media Player, AddressBook, EventKit, and much more to come. https://www.assetstore.unity3d.com/#/content/9555

Edit: The FREE U3DXT Basic edition comes with “Sneak Peeks” of everything in the Pro edition. So you can try all features of the Pro edition before committing to it.