Add ALC library dependency
Add ALC library dependency
Register the ONE store maven address in the project top-level build.gradle file.
For the Android Studio (version: bumblebee), add from settings.gradle.
Next, add the ONE store ALC library dependency to the app’s build.gradle file.
Add queries to AndroidManifest.xml
Please refer to the ONE store notices for setting up the following two cases:
For Android 11 or higher (Target SDK 30 or higher), you must add queries.
Add configuration for ONE store login
Register the ONE store maven address in the project top-level build.gradle file.
It is the same as the pre-operation when adding ALC library dependencies.
Next, add the ONE store configuration library dependency to the app's build.gradle file.
Initialize AppLicenseChecker
To request a user's purchase license using the Application License Checker, you must create an instance of AppLicenseChecker.
You must pass the license key issued by the Developer Center for license verification. As the results of whether you have a valid license are delivered through LicenseCheckerListener, you must also create a Listener at initialization.
Saving the license key
For license keys, it is recommended to use it after receiving it through a server rather than saving it as an in-app code to ensure security.
Callback registration
When initializing AppLicenseChecker, LicenseCheckerListener must be registered.
LicenseCheckeerListener is an interface for processing the results of license verifications. License verification results always call one of the LicenseCheckeerListener methods.
There are three methods: granted(), denied(), and error(), and simple result processing behavior can be used. The error() method forwards error codes and messages. For error codes, please refer to the response codes below.
Request license verification
When calling the license check, the license is delivered through communication with the ONE store server. When users are unable to 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 a license cached 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 failures or airplane mode, a locally cached license is used to ensure execution until the expiration date.
Calling StrictQueryLicense API (Non-Cached API)
Cached licenses are not to be used. If the API is used during network failure or in airplane mode, the user cannot use the app because access to the ONE store server is not possible.
Disconnecting
Call the destroy function in AppLicenseChecker to disconnect from the ONE store service.
Response Codes
The table below shows the response codes and messages for errors delivered from the ONE store ALC library to the application. Applications that use the library must process the response codes.
Last updated