Skip to content

Step 1. Set up the integration

Register the credentials you prepared in the Apple console in the Hive Console, and set up the environment for implementing Apple payment with the dedicated plugin.

1. Configure the store and console settings

To use Apple payment, you must get an authentication key from App Store Connect and then register that information in the Hive Console.

1.1. Issue an authentication key in the Apple console

Get the Private Key, Private Key ID, and Issuer ID required for payment from App Store Connect. For details, see Prerequisites.

1.2. Enter the authentication key in the Hive Console

Register the Private Key, Private Key ID, and Issuer ID you got from App Store Connect in the store settings of the Hive Console. For details, see App Store credentials.

2. Install the Hive Axyl Apple payment plugin

To implement Apple App Store payment, you must install the Hive Axyl Apple payment plugin (com.com2usplatform.hiveaxyl.payments.addon.apple) and register it during initialization. This plugin supports iOS 17+ and macOS 15+.

Install and register the plugin in the following order.

2.1. Install the package

  1. Open Package Manager in your Unity project.
  2. Search for the com.com2usplatform.hiveaxyl.payments.addon.apple package.
  3. Click Install to install the plugin.
  4. When the installation is complete, check that the com.com2usplatform.hiveaxyl.payments.addon.apple package has been added in the Project window.

2.2. Register the plugin

When you call HiveBootstrap.Initialize in Install and initialize the module, also register AddStoreKit() on builder.

using Hive.Axyl.Core;
using Hive.Axyl.Core.Unity;
using Hive.Axyl.Auth;
using Hive.Axyl.Payments;
using Hive.Axyl.Payments.Addon.Apple; // Apple StoreKit plugin

var config = CoreConfig.CreateBuilder("{appId}").Build();

HiveBootstrap.Initialize(config, builder =>
{
    builder.AddAuth();
    builder.AddToken();
    builder.AddPayments(sandbox: true);  // Development and test environment. For production builds, use AddPayments()
    builder.AddStoreKit();  // Register the Apple StoreKit plugin
});

Retrieve and use the registered Apple StoreKit plugin as follows.

// Retrieve the Apple StoreKit plugin
if (HiveCore.TryResolve<IAppleStoreKitPlugin>(out var applePlugin))
{
    // Call Apple App Store payment features using applePlugin
}

3. Optional: Set price tiers for each product in the Hive Console

In Apple App Store payment, the actual payment price is managed in the App Store. The price information you enter in the Hive Console is used only for reference in the Hive Console, so this step is optional.

To set price tiers, see Price tier.

4. Register products in the Hive Console

For how to register products to sell, see Product registration.

Caution

The Product ID of a product registered in the Apple App Store must match the Product ID of the product registered in the Hive Console. We recommend using the information entered in the Apple App Store console.

Next steps

Get the list of products registered in the Apple App Store.