Guide: iOS App Store
Baroni last edited by
This guide explains how to create and configure in-app purchases in iTunes Connect.
Table of Contents
- Register developer account
- Create your app in iTunes Connect
- iOS deployment in Unity
- Testing IAPs on your device
1. Register developer account
Enroll in the Apple Developer Program. Please note the difference in requirements for individuals or organizations. There is a $99 yearly membership fee to be a publisher on iTunes.
Having issues in the registration process? Please see this page on Apple’s support pages.
Next, go to iTunes Connect and accept the paid contracts listed under the Agreements, Tax and Banking section.
Agreeing to these contracts is required in order to sell apps or in-app purchases.
After requesting and confirming the contract, you will have to edit its Contact, Bank and Tax Info for it to get reviewed by Apple.
2. Create your app in iTunes Connect
In this step we will setup necessary certificates for your account and create a new app in iTunes Connect with in-app purchases.
2.1 Create Certificates, App IDs & Provisioning Profiles
To build your app in Xcode and publish it to the App Store later on, you will need to create certificates and provisioning profiles. This is a great resource with step-by-step instructions (follow step 2 only).
2.2 Create app
In iTunes Connect, open the My Apps section and add a new iOS app.
On the next window, fill out the required information about your app, such as its name, primary language and bundle ID.
2.3 Create in-app purchases
In the In-App Purchases tab under Features, add a new product.
You will see a list of available purchase types – consumables, non-consumables and subscriptions. Read each description carefully if you are unsure about the type you need. Make sure the information selected here matches with your product details entered in our IAP Settings editor. You will not be able to change the type or identifier of a product afterwards.
Note: Apple will reject your app if you don’t provide a way for users to restore their transactions. Keep the restore product in your IAP Settings editor and Simple IAP System will handle everything else for you (do not create an additional product in iTunes).
2.4 Add test accounts
In the Users and Roles section, switch to the Sandbox Testers tab and add a new tester entry. You don’t have to add an email address which really exists, but you have to remember its login information. If you add multiple testers with different store settings, you can even test your in-app purchases in several store languages.
3. iOS deployment in Unity
Here we will prepare our application in Unity for the iOS platform.
3.1 Enter bundle identifier
Switch to the iOS platform (File > Build Setting) and open the Unity settings for iOS by pressing Player Settings.
In the Other Settings section, change the bundle identifier to what you like it to be, but keep the format of com.company.appname. If you already have an app on iTunes Connect, make sure that the bundle identifier here is the same as displayed for your app in the Developer Console.
3.2 Check bundle version
The bundle version in the Unity settings for iOS will default to 1.0 for new apps, which is fine for now. If you’ve published an app on iTunes already, replace this with its associated bundle version from iTunes Connect (App Details section, see last screenshot).
3.3 Build app
First, enable Development Build under File > Build Settings. This enables log messages sent by Simple IAP System on your device for debug purposes. Don’t forget to disable Development Build for your live apps. Next, if you would like to get an impression of the sample shop scenes included in SIS, add the example scenes to the build. Then deploy your app to Xcode by pressing Build (on a Mac). After the project export has finished, open the produced *.xproj file with the latest version of Xcode.
In Xcode, check that the StoreKit framework has been added correctly in the Linked Framework and Libraries section on the General view (3rd party billing plugins only). If StoreKit.framework is not to be found, add it manually by clicking on the plus symbol.
4. Testing IAPs on your device
Before deploying the app on your device, open its settings and sign out with your Apple ID. This is necessary to receive the login popup later, when doing a test purchase.
Press Run in Xcode to deploy and start the application on your connected iOS device. If you have changed values in the IAP Settings editor of Simple IAP System, you need to uninstall your app from the device before building and deploying it via Xcode again. A message should show up, indicating that the build has succeeded. In case your build fails, you most likely have errors in your plugin dependencies to solve.
When the app has started on your device, enter your shop scene and try to purchase a product. Log in with your sandbox test account details when prompted. If it does not prompt for your Apple ID, check if you are really signed out in device settings.
Baroni last edited by Baroni
If you can’t see any products or if the purchase popup does not show up at all, you may have some issues with your Unity/iTunes settings and/or errors on the device. Please verify that all of the following points have been met:
- app bundle identifier in Unity matches the app identifier in iTunes Connect
- in-app product identifiers in the SIS IAP Settings editor matches the IAP identifiers created in iTunes
- you have added sandbox test user accounts in iTunes Connect
- in iTunes Connect, your Contract, Tax & Banking agreements are confirmed active
- you are logged in with a iTunes sandbox test user account on the device
Still having issues? Please have a look at the device log in Xcode for potential errors showing up.