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 Developer Center 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.
RESULT_OK
0
์ฑ๊ณต
Success
ERROR_CLIENT_NOT_ENABLED
1010
์์คํ ์ด์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ์์คํ ์ด ์ฑ ์คํ์ด ํ์ํฉ๋๋ค.
Unable to connect to ONE store. Please start the ONE store app.
ERROR_SERVICE_UNAVAILABLE
2000
์๋น์ค๋ฅผ ์ด์ฉํ ์ ์๋ ์ํ์ ๋๋ค.
Service unavailable.
Please contact ONE store.
ERROR_DATA_PARSING
2001
ํ๋ผ๋ฉํฐ๊ฐ ์ ํจํ์ง ์์ต๋๋ค.
Invalid parameter.
Please contact ONE store.
ERROR_SIGNATURE_VERIFICATION
2002
๋ผ์ด์ ์ค ํค๊ฐ ๋ง์ง ์๊ฑฐ๋ ๊ตฌ๋งค ๋ด์ญ์ด ์๋ ์ ์ ์ ๋๋ค.
The license key does not match, or the user has no purchase history.
Please check the license key at the ONE store Developer Center.
ERROR_SERVICE_TIMEOUT
2100
์๋น์ค ์๋ต์ด ์์ต๋๋ค.
No response from server.
Please check the network status.
ERROR_USER_LOGIN_CANCELD
2101
์ฌ์ฉ์๊ฐ ๋ก๊ทธ์ธ์ ์ทจ์ํ์์ต๋๋ค.
Login canceled by the user.
Please login to ONE store.
ERROR_INSTALL_USER_CANCELED
2103
์์คํ ์ด ์๋น์ค ์ค์น๋ฅผ ์ทจ์ํ์์ต๋๋ค.
ONE store service installation has been canceled. Install ONE store?
Please install ONE store.
ERROR_NOT_FOREGROUND
2104
๋ฐฑ๊ทธ๋ผ์ด๋ ์๋น์ค์์๋ ์งํํ ์ ์์ต๋๋ค.
Cannot proceed within the background service
RESULT_UNKNOWN
-1
์ ์ ์๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ์์ต๋๋ค.
An unknown error has occurred.
Please contact ONE store.
RESULT_USER_CANCELED
1
์ฌ์ฉ์๊ฐ ๋ก๊ทธ์ธ์ ์ทจ์ํ์์ต๋๋ค.
Login canceled by the user.
Please login to ONE store.
RESULT_SERVICE_UNAVAILABLE
2
๋จ๋ง ๋๋ ์๋ฒ ๋คํธ์ํฌ ์ค๋ฅ๊ฐ ๋ฐ์ํ์์ต๋๋ค.
An error has occurred in your device or server network.
Please check your network status.
RESULT_ALC_UNAVAILABLE
3
ALC api ๋ฒ์ ์ ๋ณด๊ฐ ๋ฎ์ต๋๋ค. ํด๋น ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ ๋ฐ์ดํธ ํด์ฃผ์ธ์.
An updated ALC api version is required. Please update the library.
Please update the ALC library to the latest version.
RESULT_DEVELOPER_ERROR
5
ํ๋ผ๋ฉํฐ๊ฐ ์ ํจํ์ง ์์ต๋๋ค.
Invalid parameter.
Please contact ONE store.
RESULT_ERROR
6
์ ์๋์ง ์์ ๊ธฐํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์์ต๋๋ค.
An unknown error has occurred.
Please contact ONE store.
Last updated