Setup Guide

Open Settings Window

Go to Tools -> Gley -> EasyIAP

Download Unity IAP SDK

Easy IAP is just a wrapper over the official Unity IAP SDK, to make integration a lot more easier. Official Unity IAP SDK is needed to work.

Method 1: Press Import Unity IAP SDK from the Settings Window

Method 2: Enable In-App Purchasing from Unity Gaming Services

Method 3: Install it from Package Manager

It is recommended to use the latest version available, not the verified one.

Add in-app products

The plugin supports 3 types of in-app products:

Consumable

Users can purchase the Product repeatedly. Consumable Products cannot be restored.

Ex: Virtual currencies, Health potions, Temporary power-ups.

Non-Consumable

Users can only purchase the Product once. Non-Consumable Products can be restored. Ex: Weapons or armor, Unlock extra content, No ads

Subscription

Users can access the Product for a finite period of time. Subscription Products can be restored. Ex: VIP status granting daily bonuses, A free trial, Monthly access to an online game

If Debug you will get an additional message about the status of your purchase, useful for debugging your integration.

Select the platforms you intend to build your app for.

Press Add New Product or Remove Product to add or remove your store products.

Product Name

Name of your product, it will be used in your code to make a purchase. Name cannot contain white spaces, or special characters and cannot start with number.

Product Type

Consumable, Non-Consumable, Subscription

Reward Value

For consumable - value of the reward given to the user(ex: number of in game coins).

For non-consumable and subscription - does not have any meaning, should be set to 0.

IDs

IDs for each platform. For each platform you enable a corresponding ID field will be generated.

Receipt validation

Receipt validation helps you prevent users from accessing content they have not purchased. To enable it check the Use Receipt Validation checkbox.

To do this you need to obfuscate your encryption keys. To do this go to Services > In-App Purchasing > IAP Receipt Validation Obfuscator, and follow the instructions.

Paste your Google Play public key (from the application’s Google Play Developer Console’s Services & APIs page).

Click Obfuscate Google Play License Key.

You can read more about validation in the official Unity documentation: https://docs.unity3d.com/Packages/com.unity.purchasing@4.9/manual/UnityIAPValidatingReceipts.html

Save

Every time you make a change inside Settings Window press the Save button.

Test

In-app products can be tested on devices only on apps downloaded from the store using test users. On Editor, placeholders are used.

For more info on how to create your app and products on the store, you can check the official documentation from Unity: https://docs.unity3d.com/Packages/com.unity.purchasing@4.9/manual/UnityIAPGoogleConfiguration.html

All code references are already implemented in our package, no setup is needed.

To test if your SDK integration and your IDs are correct please build the test scene provided:

Assets/Gley/EasyIAP/Example/Scenes/EasyIAPTest.unity

Last updated