Configure unity project with IAPs for MacOS

When I created the game Asteroids Blast I ran into the problems with testing of In-App purchases on the macOS platform: I successfully built an application, but in-app purchases did not work. Spending some time I solved the problem and now I want to share with you a simple step by step list on how to make it work.

For building my project I used Unity 2019.3.13f and In-App Purchasing package version 2.0.6, so in the future some of these steps may be changed.

So let’s go:

  1. Open Build Settings, check Create Xcode Project and build it;
  2. Open Xcode project;
  3. Choose Project Target;
  4. In tab General set Bundle Identifier to yours (it not auto set from Unity);
  5. In tab Signing & Capabilities:
    1. setup Signing
    2. Add Capability “In-App Purchase”
    3. Add Capability “App Sandbox” and check “Outgoing Connections (Client)”
  6. In tab Build Phases add New Copy Files Phase:
    1. Destination set to PlugIns;
    2. In project folder find Plugins/unitypurchasing.bundle and drag-n-drop it to files list

On this step you’ll be able to build project and test purchases in Sandbox.

Before uploading to AppStore you need to make the next steps:

  1. Find file: Plugins/unitypurchasing.bundle, right-click on it and choose Show Package Contents;
  2. Then find file: Contents/Info.plist and edit it;
  3. Replace com.unity.purchasing.unitypurchasing to any other value, for example YOUR_BUNDLE_ID.unitypurchasing

Now project ready to archive and upload to AppStore.

Leave a Reply