Version: 2022.3
言語: 日本語
Unity IAP
Apple App Store と Mac App Store の設定

Unity IAP の設定

Note: Screenshots and menu choices might differ between release versions.

概要

ここでは、 In-App Purchasing (IAP、アプリ内課金) を有効にする方法を説明します。

Unity IAP パッケージには、コード化されたアプローチとコードを使わない方法が用意されており、以下を行うことができます。 - ユーザーがゲーム内でアイテムを購入するのを可能にします。 - ストアに接続することで、購入による収益を得ることができます。

以下は、その手順の概要です。

  • このゲームのアプリ内課金戦略を定義します。

  • プロジェクトを Unity のサービスとして設定します。

  • IAP をアクティベートして、自動的にパッケージをインストールします。

  • 設定を行います。

  • 販売したいゲーム内アイテムを作成し、カタログ化します。

  • Use the Codeless IAP button to give users a way to buy items. Then, once you have the logic working, consider customizing the button look and feel. Or use the scripted IAP for a rich API to enhance this process.

  • アプリケーションを、Google、Apple、Android などの関連アプリストアに接続します。

  • ストアにアイテムを加えます。

すべてをまとめます。

  • このドキュメント、サポート、および IAP フォーラムのガイダンスを参考にして、IAP を設定します。
  • 全てをテストします。
  • ライブにします。

You can also do many of these steps, or fine-tune what you create, with the In-App Purchasing API.

Note: Versions of Unity IAP between 4.2.0 and 4.6.0 automatically install Unity Analytics. Unity Analytics is a paid service, and if your usage exceeds the free tier limits, you will be responsible for paying for your usage. To avoid using Unity Analytics, install Unity IAP 4.7.0 or later, and/or remove Unity Analytics from your project (which you can learn more about here).

はじめに

Note: The Samsung Galaxy store is now obsolete and is no longer supported in the Unity In-App Purchasing package 4.0.0 and later. This guide to configure the Samsung Galaxy store only applies to the IAP package version 3.1.0 and earlier. If you are using the Unity IAP package 4.0.0 and later and you want to implement a Samsung Galaxy store, use the Unity Distribution Platform instead.

  1. Unity エディターで Unity プロジェクトを開きます。

  2. Window > General > Services を選びます。Services ウィンドウが表示されます。

  3. プロジェクト ID を作成し、そのプロジェクトを組織に接続します。

  4. COPPA のコンプライアンスに関する質問に答えます。

  5. Services ウィンドウには、サービスの一覧が表示されます。In-App Purchasing をクリックします。

  6. Project Settings ウィンドウが表示されます。

  7. Activate the toggle next to In-App Purchasing Settings to ON.

This automatically installs the IAP package from the package manager, providing you with new features and menu items to help you manage IAP.

次のステップ

アプリ内課金戦略の決定

プレイヤーが購入するアイテムを作り、その ID を取得します。

You must tie product identifiers (strings) to each item you are selling by using a specified format. Some stores require that you customize the Product ID for their stores.

計画

  • Define your strategy to determine when/how users can buy things
  • 価格戦略を決定します。
  • プロダクトのタイプ (サブスクライブ、消費型、非消費型) の定義

詳細情報の取得

IAP サンプル

  1. From the IAP Project Settings Page, select Open Package Manager from Options.
  2. In App Purchasing へ移動します。右側の情報パネルで、Samples を見つけます。
  3. Expand Samples, then select Import.

フォーラムのチュートリアル

Visit the Unity forum.

Unity Learn IAP クラス

Refer to the Unity Learn IAP classes.

トラブルシュート

アップグレード時のコンパイルエラーを解決する方法

Unity IAP バージョン 2.x から将来のバージョンにアップグレードする場合の重要な注意点

If you are updating from Unity IAP (com.unity.purchasing + the Asset Store plugin) versions 2.x to future versions, to resolve compilation errors, complete the following actions:

  • IAPProductCatalog.jsonBillingMode.jsonAssets/Plugins/UnityPurchasing/Resources/ から Assets/Resources/ に移動します。
  • AppleTangle.csGooglePlayTangle.cs を ‘Assets/Plugins/UnityPurchasing/generated’ から Assets/Scripts/UnityPurchasing/generated へ移動します。
  • Assets/Plugins/UnityPurchasing に残っている Asset Store プラグインのフォルダーとファイルをすべてプロジェクトから削除します。

Unity IAP インテグレーションの一般的なコンパイラーエラー

The following error messages might indicate that Unity IAP is deactivated in the Unity Cloud Services window, or that Unity is disconnected from the Internet: * CS0246 * System.Reflection.ReflectionTypeLoadException * UnityPurchasing/Bin/Stores.dll * UnityEngine.Purchasing

これらのエラーを解決するには、以下を行います。

Reload the Services window by closing, then reopening it. After reloading, ensure that the Unity IAP service is active. If this doesn’t work, try to disconnect and reconnect to the Internet, then sign back into Unity Services and re-activate Unity IAP.

ノート: プロジェクトの 所有者 または 管理者 の役割を持っている必要があります。

Unity IAP
Apple App Store と Mac App Store の設定