Make Purchases through Google Play Store

In order to use IAP with Google Play Store, you must have an active Google Session, to do this read our Google Sign in Guide or take a look at our in-house feature UPA where you can start a Remote Login Session for Google!

Create In App Purchases on Google

To utilize IAP you must make the In App Purchases in Google Play Console.

Some important information to find is your application name; it generally follows this style "com.company.app_name", this name can be found under the overview of all your applications, or inside the application page beneath the title.

Underneath the Monetization page in the left menu list, you will see Products which contains In-app products. This is where you set up your products to use IAP with.

Create new in-app product, supply all the required fields.

Creating Purchases In Engine

To create Purchases in Unity, you must inherit from IDetailedStoreListener and import the required methods that follows.

This is how you add products to your IAPManager:

Here is how you'd initiate a Purchase:

This snippet shows you how you'll connect LootLocker IAP to the flow:

In this example LootLockerIAPManager.cs has a RedeemPurchase(Product product) method which will be described underneath Redeem Purchase For Player and Redeem Purchase For Class

This is the complete script:

Redeem Purchase For Player

Product is from using UnityEngine.Purchasing;

Which is a Package called "In-App Purchasing", read more here.

Redeem Purchase For Class

Product is from using UnityEngine.Purchasing;

Which is a package called "In-App Purchasing", read more here.

Last updated