Version: 2018.2 (switch to 2018.1 or 2017.4)
Unity IAP
Configuring for Apple App Store and Mac App Store
Other Versions

Setting up Unity IAP

Once you have set up your project for Unity Services, you can enable the Unity IAPSee IAP More info
See in Glossary
service.

Step 1. Enable In-App Purchasing

In the Services window, select In-App Purchasing.

Click the Enable button to enable In-App Purchasing.

Note: Common Unity IAP integration compiler errors

The following error messages may indicate that Unity IAP is disabled in the Unity Cloud Services window, or that Unity is disconnected from the Internet:

  • CS0246: The type or namespace name IPurchaseReceipt could not be found.
  • System.Reflection.ReflectionTypeLoadException
  • UnityPurchasing/Bin/Stores.dll
  • UnityEngine.Purchasing

To resolve these errors, first try reloading the Services window. A quick way to do this is to close it and then reopen it. Once reloaded, make sure that Unity IAP is enabled.

If this doesn’t work, try disconnecting and reconnecting to the Internet, then sign back into Unity Services and re-enable Unity IAP. Only users with Unity Services “owner” or “manager” roles for the registered organisation can enable the Unity IAP Service.

Step 2. COPPA Compliance

The Children’s Online Privacy Protection Act (COPPA) applies to the online collection of personal information from children under 13. The rules spell out what you must include in a privacy policy, when and how to seek verifiable consent from a parent, and what responsibilities you have to protect children’s privacy and safety online. If you have not already specified a COPPA(Children’s Online Privacy Protection Act) COPPA is a US law that applies to apps that collect personal information and are targeted to children under the age of 14. More info
See in Glossary
choice in your AnalyticsA data platform that provides analytics for your Unity game. More info
See in Glossary
settings, a dialog window will appear asking about the target age for users of your app in order to ensure COPPA compliance. Choose the appropriate answer and then click Save Changes.

The COPPA Compliance target age prompt
The COPPA Compliance target age prompt

Step 3. Adding the IAP package

To import the Unity IAP package into your project, click Import.

The IAP Import Package option
The IAP Import Package option

When you import the package, a new folder called PluginsA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plugins you can use in Unity: Managed plugins (managed .NET assemblies created with tools like Visual Studio) and Native plugins (platform-specific native code libraries). More info
See in Glossary
is automatically added to your project. This folder contains UnityPurchasing assetsAny media or data that can be used in your game or project. An asset may come from a file created outside of Unity, such as a 3D model, an audio file or an image. You can also create some asset types in Unity, such as an Animator Controller, an Audio Mixer or a Render Texture. More info
See in Glossary
required to use Unity IAP.

The imported IAP package files in the project window
The imported IAP package files in the project window

Click Back to services to review the Services panel.

The Services window back button
The Services window back button

Make sure that that Analytics and In-App Purchasing are both labelled ON as shown below.

Services window showing IAP and Analytics switched on
Services window showing IAP and Analytics switched on

You can now begin implementing Unity In-App Purchases into your project.

Did you find this page useful? Please give it a rating:

Unity IAP
Configuring for Apple App Store and Mac App Store