ここでは、Unity のゲームでアプリ内課金ストアを利用するのに必要な、デジタルレコードと関連を構築する手順を説明します。Unity IAP 課金 API がターゲットとなります。
アプリ内課金 (IAP) は、お金とデジタルプロダクトとを取引する過程です。プラットフォームのストアでは、デジタルプロダクトである製品を購入することが可能です。プロダクトには、たいてい文字列データタイプである ID と、有効な期間を表すタイプが与えられています。タイプは、subscription、 consumable (再購入可能)、 non-consumable (1度だけ購入可能) が一般的です。
Write a game implementing Unity IAP. See Unity IAP Initialization and the Sample IAP Project.
後で、Google Play デベロッパーコンソールで使用するために、手元にゲームのプロダクト ID を控えておきます。
リリース版で署名された Android APK をビルドします。
TIP: キーストアファイルが安全に保存されているかを確認してください。オリジナルのキーストアは アプリの更新で Google Play のアプリを公開するときに常に必要です。
ヒント: 変更した APK を Developer Console に読み込むことを最初に要求されずにサイドローディングできるよう、ローカルテストの間は最後にアップロードした APK の Bundle Version Code を再利用します。Android Player の設定を参照してください。
ゲームをパブリッシュする Google アカウントを使って、Google Play デベロッパーコンソール で Android アプリケーションを登録します。
NOTE: This guide uses the Google Play License Testing approach for testing in-app purchase integration.
Choose Create app.
Give the application an App name and select the appropriate options for your game.
Navigate to Testing/Closed testing in the left nav and choose Create track. Select your APK and upload it. Also complete the basic Dashboard requirements, upload screenshots and add a Short and Full description. You can also create an Internal test track.
Now that you have uploaded our first binary, you can add the IAP products.
Navigate to In-app Products and choose Create product.
Define the Product ID , product details and price. Remember to activate the product after saving.
Managed product_ を選択して、consumable (消費型) か non-consumable (非消費型) を特定できます。 Subscription も Unity IAP でサポートされています。
NOTE: The “Product ID” here is the same identifier used in the game source code, added to the [Unity IAP ConfigurationBuilder] instance via AddProduct()
or AddProducts()
, like “gold50”.
Add your testers to License Testing.
Navigate to All Apps on your Google Developer dashboard.
Select Settings/License Testing. Add each Google Account email address. Save changes.
NOTE: There may be a delay of several hours from the time you publish the APK.
Note: To test updates retaining permission to purchase IAPS’s for free, you may side-load applications, updating the existing store-downladed APK install.
To test the IAP, make a purchase on a device logged in with a Tester Google Account. A modified purchase dialog box appears to confirm the fact this product is under test and is free.
WARNING: If this dialog box does not appear, then the Tester Google Account will be charged real money for the product.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.