Using ALC SDK V2 in Unity

Overview

The ONE store App License Verification Plug-in is a plug-in that allows you to easily apply paid app purchase checks by expanding assets in the Unity environment.

The guide below explains how to set up and use plug-ins in your project and how to implement the ONE store App License Verification Library feature.

ONE store App License Verification Plug-in settings

Downloading and using plug-ins

  1. Download the latest version of the ONE store ALC plug-in for Unity from the Release page of the ONE store SDK sample GitHub.

  2. In the Unity menu bar, click Assets > Import Package > Custom Package.

  3. Locate where you downloaded the ONE store SDK plugin and select the .unitypackage file.

  4. In the Import Package dialog box, leave all assets selected and click Import.

Folders are added when packages are imported. These folders contain the app license validation library.

  • Assets > OneStoreCorpPlugins folder

Setting up builds

Please refer to the ONE store notices for setting up the following two cases:

Add the items below through the Player settings of Unity.

  • Custom Main Manifest

  • Custom Main Gradle Template

  • Custom Launcher Gradle Template

The files are created in the Assets > Plug-ins > Android folder.

Applying ONE store ALC (Application License Checker) library to games

Copying a ONE store license key

Enter the license management menu from the ONE store app product status. A license key is required to use ALC.

Create an ALC object by copying the license key of the app provided by the ONE store Developer Center.

Call the Initialize() function to set the default settings and receive the verification result event through the ILicenseCheckCallback interface.

The tasks below are prerequisites for connecting to the ONE store service and requesting app license verification.

Requesting license verification

When calling the license check, the license is delivered through communication with the ONE store server. When users cannot access the ONE store server normally due to network failures or airplane mode, etc., a cache policy is generally used to ensure the app runs during the validity period of the cached license. If you do not want to use the cache policy, you can use it without using the cached license through the strictQueryLicense API.

Calling QueryLicense API (Cached API)

Works in conjunction with the cache policy. Generally, a user's purchase history license is delivered through the ONE store server, but when access to the ONE store server is not possible due to network failure or airplane mode, a locally cached license is used to ensure execution until the expiration date.


using OneStore.Alc;

class YourCallback: ILicenseCheckCallback
{
// ILicenseCheckCallback implementations.
public void OnGranted(string license, string signature) { }
public void OnDenied() {}
public void OnError(int code, string message)
}

_appLicenseCheckerImpl.QueryLicense();

Calling StrictQueryLicense API (Non-Cached API)

Cached licenses are not to be used. If the API is used in a network failure situation or airplane mode, the user cannot use the app because the ONE store server is not accessible.


using OneStore.Alc;

class YourCallback: ILicenseCheckCallback
{
// ILicenseCheckCallback implementations.
public void OnGranted(string license, string signature) { }
public void OnDenied() {}
public void OnError(int code, string message)
}

_appLicenseCheckerImpl.StrictQueryLicense();

Disconnecting

Call the destroy function in AppLicenseChecker to disconnect from the ONE store service.


using OneStore.Alc;

_appLicenseCheckerImpl.Destroy();

Last updated