Step-by-step Integration¶
First Steps¶
- Install Steamworks.NET.
- Basic Balancy integration.
-
Install Balancy Steam module.
-
Add game in Steam dashboard.
- Add Steam platform in Balancy on platforms page.
-
Copy App ID, WebAPI key from Steam partner dashboard to Balancy.
-
Now you can authorize using Steam and buy products using Balancy.
Prerequirements¶
You need to init Steam SDK before using Balancy. Check SDK docs. Take a look on the provided SteamManager.cs.
Init Balancy after initing Steam SDK.
Authorization¶
Just call SteamNetwork.SteamInstance.Login
:
SteamNetwork.SteamInstance.Login(result =>
{
if (!result.Success)
Debug.LogError("Steam auth error: " + result.Error.Code + " => " + result.Error.Message);
});
Payments¶
- First, read payments doc and in-game store documentation.
-
Now you can add your own products to use it later. You can do it on the products page.
Localized name is a special type. This string will automatically use translation depending on user language settings. You can read about our localization system on this page.
Price is in USD
Price on this page is in USD and it will be used during the purchase.
-
Deploy changes on Deploy page.
Don't forget to deploy
All changes applied only after deploy. If you change something on the products page, deploy everything before testing.
-
In the simple integration you can just start purchasing process like this:
Payments.PurchaseProduct("gold.pack", res => { Debug.Log("Product purchase: " + res.Success); if(res.Success) { // give your player gold } });
But we strongly recommend you to use our in-game store.
-
Internally we do all the magic (including server validation).
Payments system works only if you run build via Steam
For payments you need Steam overlay, so you can't test this functionality in the editor or in standalone build. You have to run the game via Steam.
Potential Issues¶
-
App ID: 480. If your game shows "Spacewar" instead of your actual game when running in Unity, it means that Steam is not detecting your correct Steam App ID. This happens because "Spacewar" (App ID: 480) is a default placeholder for testing Steam integration.
Read about steam_appid.txt.