Available in Classic and VPC
This guide provides instructions for using the GAMEPOT Android SDK in the Android environment. You can integrate the game and dashboard by installing the SDK and configuring the environment.
Requirements
The recommended specifications required to use GAMEPOT SDK for Android are as follows:
- The minimum requirement is Android level 24 or higher. If you need support for earlier versions, please contact Ncloud Support with your request.
Install SDK and configure environment
You can install the Android SDK, configure the environment, and integrate the game and GAMEPOT dashboard to use features required for the game development.
The GAMEPOT SDK supports the following languages.
- Korean, English, Italian, Thai, Vietnamese, Japanese, Chinese (Simplified/Traditional), Indonesian, German, Spanish, French
When you reset GAMEPOT, the interface will automatically display in the language you selected during registration. Languages not supported will be displayed in English.
SDK installation
To install the GAMEPOT Android SDK and configure your project, follow these steps.
- Add the NBase SDK to your
build.gradleorbuild.gradle.ktsfile. - Starting with GAMEPOT 3.0, you can easily integrate external libraries via Gradle configuration.
Set Kotlin Gradle
For projects using the Kotlin DSL, add the following configuration.
- Add the following configuration to the
build.gradle.ktsfile in the project root.
Kotlin:
dependencyResolutionManagement {
repositories {
...
google()
maven(url = "https://repo.nbase.io/repository/nbase-releases")
}
}
- Add the following configuration to the
build.gradle.ktsfile in the app module (Module: app).
Kotlin:
dependencies {
...
implementation("io.nbase:nbasesdk:latest.release")
}
If you are using both Google Sign-In and Google Play payments, use the following example as a reference.
Kotlin:
dependencies {
...
implementation("io.nbase:nbasesdk:latest.release")
implementation("io.nbase:nbase-adapter-provider-google:latest.release")
implementation("io.nbase:nbase-adapter-billing-googleplay:latest.release")
}
Set Gradle for Java
For projects using Groovy DSL, add the following configuration.
- Add the following configuration to the
build.gradlefile in the project root.
Groovy:
allprojects {
repositories {
...
google()
maven { url "https://repo.nbase.io/repository/nbase-releases" }
}
}
- Add the following configuration to the
build.gradlefile in the app module (Module: app).
Groovy:
dependencies {
...
implementation("io.nbase:nbasesdk:latest.release")
}
If you are using both Google Sign-In and Google Play payments, use the following example as a reference.
Groovy:
dependencies {
...
implementation("io.nbase:nbasesdk:latest.release")
implementation("io.nbase:nbase-adapter-provider-google:latest.release")
implementation("io.nbase:nbase-adapter-billing-googleplay:latest.release")
}
Supported AOS-dependent modules are as follows:
| Name | Description | Dependency modules |
|---|---|---|
| io.nbase:nbasesdk | GAMEPOT base module | X |
| io.nbase:nbase-adapter-provider-google | Google login | X |
| io.nbase:nbase-adapter-provider-apple | Apple login | X |
| io.nbase:nbase-adapter-provider-facebook | Facebook login | com.facebook.android:facebook-login:latest.release |
| io.nbase:nbase-adapter-provider-kakao | Kakao login | X |
| io.nbase:nbase-adapter-provider-line | LINE login | X |
| io.nbase:nbase-adapter-provider-naver | NAVER login | X |
| io.nbase:nbase-adapter-provider-huawei | Huawei login | X |
| io.nbase:nbase-adapter-provider-playgame | Google Play Games login | X |
| io.nbase:nbase-adapter-provider-x | X login | X |
| io.nbase:nbase-adapter-billing-googleplay | Google Play Store | com.android.billingclient:billing:8.0.0 |
| io.nbase:nbase-adapter-billing-onestore | ONE Store | X |
| io.nbase:nbase-adapter-billing-galaxy | Galaxy Store | X |
| io.nbase:nbase-adapter-billing-huawei | Huawei Store | X |
Guest login is included in the basic module.
Preparation
Before implementing the SDK, verify the following required settings.
- Copy the project ID and project key from Dashboard > Project settings.
- To configure settings for login, the store, and integration, go to Dashboard > Project settings.
- See Configuration by login method for each login, set it in the console and add it to the dashboard.
- If you are using in-app purchases, see Configuration by store to configure them in the console and add them to the dashboard.
- Register the items for in-app purchases for each store under Dashboard > Payment > In-app.
Reset
To perform an initialization, add the following code to the object used in the first scene loaded when the game starts.
Kotlin:
import android.util.Log
import com.nbase.sdk.NBase
import com.nbase.sdk.Store
NBase.initialize(activity, projectId, projectKey, storeId, language, region) { init, e ->
if (e != null) {
Log.e("NBase", e.message ?: "initialize fail")
} else {
Log.i("NBase", "initialize success: ${init.toString()}")
}
}
Java:
import android.util.Log;
import com.nbase.sdk.NBase;
import com.nbase.sdk.Store;
NBase nBase = NBase.INSTANCE;
nBase.initialize(activity, projectId, projectKey, Store.GOOGLE, language, region, (init, e) -> {
if (e != null) {
Log.e("NBase", "initialize fail: " + e.getMessage());
} else {
Log.i("NBase", "initialize success: " + init.toString());
}
return null;
});
- Parameters
The following table describes the parameters required for initialization.
| Key | Type | Description | Required |
|---|---|---|---|
| projectId | String | Project ID (Dashboard → Project settings) | O |
| projectKey | String | Project key (Dashboard → Project settings) | O |
| storeId | String | Store ID (See the following table) | O |
| language | String | Language code (en, ko, jp, etc.) | O |
| region | String | Region name (kr, jp, sg, us, eu, preview) | O |
See the following table for store identifiers.
| Key | Description |
|---|---|
| Store.GOOGLE | Google Play Store |
| Store.ONE | ONE Store |
| Store.GALAXY | Galaxy Store |
| Store.AMAZON | Amazon Store |
| Store.HUAWEI | Huawei Store |
- Callback
The following table describes the information passed to the initialization callback.
| Key | Type | Description |
|---|---|---|
| status | Boolean | Condition |
| language | String | Language |
| country | String | Country |
| remote_ip | String | IP |
| platform | String | Platform |
| sandbox | Boolean | Sandbox status |
Login feature
This section describes how to authenticate users using various authentication methods through the login feature.
Use login feature
To call the SDK login feature from the login UI implemented by the developer, see the following code.
Kotlin:
import android.content.Intent
import android.util.Log
import com.nbase.sdk.NBase
import com.nbase.sdk.Provider
NBase.signIn(activity, Provider.GOOGLE.toString()) { user, e ->
if (e != null) {
if (e.errorCode == 414) { // Maintenance
// Maintenance
Log.e("NBase", "Maintenance: " + e.message) // Maintenance message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus) { status, err ->
// Popup handling
}
*/
} else if (e.errorCode == 413) { // Update
// Update
Log.e("NBase", "Update: " + e.message) // Update message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus) { status, err ->
// Popup handling
}
*/
} else {
// signIn Failed
Log.e("NBase", "signIn Failed: " + e.errorCode + ", " + e.message)
}
} else {
// signIn Success
Log.e("NBase", "signIn Success: " + user.toString())
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
NBase.onActivityResult(requestCode, resultCode, data)
}
Java:
import android.content.Intent;
import android.util.Log;
import com.nbase.sdk.NBase;
import com.nbase.sdk.Provider;
NBase nBase = NBase.INSTANCE;
nBase.signIn(activity, Provider.GOOGLE.toString(), (user, e) -> {
if (e != null) {
if (e.getErrorCode() == 414) { // Maintenance
// Maintenance
Log.e("NBase", "Maintenance: " + e.getMessage()) // Maintenance message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus, (status, err) -> {
// Popup handling
}
*/
} else if (e.getErrorCode() == 413) { // Update
// Update
Log.e("NBase", "Update: " + e.getMessage()) // Update message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus, (status, err) -> {
// Popup handling
}
*/
} else {
// signIn Failed
Log.e("NBase", "signIn Failed: " + e.getErrorCode() + ", " + e.getMessage());
}
} else {
// signIn Success
Log.e("NBase", "signIn Success: " + user.toString());
}
return null;
});
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
nBase.onActivityResult(requestCode, resultCode, data);
}
If you use the pop-up provided by the SDK when updating or checking, add the following code.
Kotlin:
NBase.showAppStatusPopup(activity, appStatus){ status, e ->
if (status.close){
// App Close
}
else if (status.next){
// Next, Optional update
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.showAppStatusPopup(activity, appStatus){ status, e ->
if (status.getClose()){
// App Close
}
else if (status.getNext()){
// Next, Optional update
}
}
- Provider
The following table describes the service types used in the login feature.
| Key | Description |
|---|---|
| Provider.GOOGLE | |
| Provider.ANONYMOUS | Guest |
| Provider.FACEBOOK | |
| Provider.APPLE | Apple |
| Provider.KAKAO | Kakao |
| Provider.GOOGLEPLAY | Google Play Games |
| Provider.STEAM | Steam |
| Provider.X | X |
| Provider.LINE | LINE |
| Provider.NAVER | NAVER |
| Provider.GITHUB | GitHub |
| Provider.MICROSOFT | Microsoft |
| Provider.HUAWEI | Huawei |
- User
The following table describes the fields of the User object.
| Key | Type | Description |
|---|---|---|
| id | string | User's unique ID |
| socialId | string | Social ID |
| name | string | Name (if provided) |
| string | Email (if provided) | |
| token | string | Token |
| age | int | Age (if provided) |
| profile | string | Profile (if provided) |
| customField | string | Custom field |
| isSignUp | bool | Registration status |
| appStatus | AppStatus | Maintenance/update status |
- AppStatus
The following table describes the fields of the AppStatus object.
| Key | Type | Description |
|---|---|---|
| message | string | Message |
| startedAt | long | Start Time |
| endedAt | long | End time |
| currentAppVersion | string | Current app version |
| updateAppVersion | string | Update app version |
| currentAppVersionCode | string | Current app version code |
| updateAppVersionCode | string | Update app version code |
| isForce | bool | Whether to force update |
| url | string | URL registered for maintenance/update |
Login UI provided by SDK
You can use the login UI provided by GAMEPOT SDK in a completed form.
Use the following code to call the login UI provided by the SDK.
Kotlin:
NBase.openSignInUI(activity) { user, e ->
if (e != null) {
if (e.errorCode == 414) { // Maintenance
// Maintenance
Log.e("NBase", "Maintenance: " + e.message) // Maintenance message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus) { status, err ->
// Popup handling
}
*/
} else if (e.errorCode == 413) { // Update
// Update
Log.e("NBase", "Update: " + e.message) // Update message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus) { status, err ->
// Popup handling
}
*/
} else {
// signIn Failed
Log.e("NBase", "signIn Failed: " + e.errorCode + ", " + e.message)
}
} else {
// signIn Success
Log.e("NBase", "signIn Success: " + user.toString())
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.openSignInUI(activity, (user, e) -> {
if (e != null) {
if (e.getErrorCode() == 414) { // Maintenance
// Maintenance
Log.e("NBase", "Maintenance: " + e.getMessage()) // Maintenance message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus, (status, err) -> {
// Popup handling
}
*/
} else if (e.getErrorCode() == 413) { // Update
// Update
Log.e("NBase", "Update: " + e.getMessage()) // Update message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus, (status, err) -> {
// Popup handling
}
*/
} else {
// signIn Failed
Log.e("NBase", "signIn Failed: " + e.getErrorCode() + ", " + e.getMessage());
}
} else {
// signIn Success
Log.e("NBase", "signIn Success: " + user.toString());
}
return null;
});
Auto login (optional)
After initialization, it may attempt to automatically log in with the last authentication method you logged in with. We recommend checking the last login provider type before attempting automatic login.
Kotlin:
// Check the last login provider type.
val lastProviderType = NBase.getLastProviderType()
if (lastProviderType != Provider.NONE) {
// Attempt automatic login only when a valid provider is available.
NBase.signInLastLoggedIn(activity) { user, e ->
if (e != null) {
if (e.errorCode == 414) { // Maintenance
// Maintenance
Log.e("NBase", "Maintenance: " + e.message) // Maintenance message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus) { status, err ->
// Popup handling
}
*/
} else if (e.errorCode == 413) { // Update
// Update
Log.e("NBase", "Update: " + e.message) // Update message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus) { status, err ->
// Popup handling
}
*/
} else {
// signIn Failed
Log.e("NBase", "signIn Failed: " + e.errorCode + ", " + e.message)
}
} else {
// signIn Success
Log.e("NBase", "signIn Success: " + user.toString())
}
}
} else {
// No last login information
Log.e("NBase", "No last login provider found")
}
Java:
NBase nBase = NBase.INSTANCE;
// Check the last login provider type.
Provider lastProviderType = nBase.getLastProviderType();
if (lastProviderType != Provider.NONE) {
// Attempt automatic login only when a valid provider is available.
nBase.signInLastLoggedIn(activity, (user, e) -> {
if (e != null) {
if (e.getErrorCode() == 414) { // Maintenance
// Maintenance
Log.e("NBase", "Maintenance: " + e.getMessage()) // Maintenance message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus, (status, err) -> {
// Popup handling
}
*/
} else if (e.getErrorCode() == 413) { // Update
// Update
Log.e("NBase", "Update: " + e.getMessage()) // Update message
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, user?.appStatus, (status, err) -> {
// Popup handling
}
*/
} else {
// signIn Failed
Log.e("NBase", "signIn Failed: " + e.getErrorCode() + ", " + e.getMessage());
}
} else {
// signIn Success
Log.e("NBase", "signIn Success: " + user.toString());
}
return null;
});
} else {
// No last login information
Log.e("NBase", "No last login provider found");
}
- getLastProviderType()
Return the last logged in provider type.
The following table describes the return values of the getLastProviderType() method.
| Return Type | Description |
|---|---|
| Provider | Last login provider type |
- signInLastLoggedIn() Parameter
It attempts to automatically log in using the authentication method used for the last login.
The following table describes the parameters of the signInLastLoggedIn() method.
| Key | Type | Description | Required |
|---|---|---|---|
| activity | Activity | Current activity | O |
- Callback
The following table describes the values passed to the automatic login callback.
| Key | Type | Description |
|---|---|---|
| user | User | User information upon successful login |
| error | Error | Error information upon login failure |
Log out
Use the following code to log out of your GAMEPOT account.
Kotlin:
NBase.signOut(activity) { status, e ->
if (e != null) {
Log.e("NBase", "signOut Fail")
Log.e("NBase", "error.message : " + e.message.toString())
} else {
Log.e("NBase", "signOut")
Log.e("NBase", "status : " + status.toString())
// Processing logic after successful logout
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.signOut(activity, (status, e) -> {
if (e != null) {
Log.e("NBase", "signOut Fail");
Log.e("NBase", "error.message : " + e.getMessage());
} else {
Log.e("NBase", "signOut");
Log.e("NBase", "status : " + status.toString());
// Processing logic after successful logout
}
return null;
});
- Parameter
The following table describes the parameters of the getLastProviderType() method.
| Key | Type | Description | Required |
|---|---|---|---|
| activity | Activity | Current activity | O |
- Callback
The following table describes the values passed to the logout callback.
| Key | Type | Description |
|---|---|---|
| status | Boolean | Logout success status |
Withdraw from membership
Use the following code to use the SDK membership withdrawal feature.
Kotlin:
NBase.deleteMember(providerId) { status, e ->
if (e != null) {
Log.e("NBase", "deleteMember Fail")
Log.e("NBase", "error.message : " + e.message.toString())
} else {
Log.e("NBase", "deleteMember")
Log.e("NBase", "status : " + status.toString())
// Logic after successful membership withdrawal
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.deleteMember(providerId, (status, e) -> {
if (e != null) {
Log.e("NBase", "deleteMember Fail");
Log.e("NBase", "error.message : " + e.getMessage());
} else {
Log.e("NBase", "deleteMember");
Log.e("NBase", "status : " + status.toString());
// Logic after successful membership withdrawal
}
return null;
});
- Parameters
The following table, this section, describes the parameters that must be passed for a membership withdrawal.
| Key | Type | Description | Required |
|---|---|---|---|
| providerId | Provider | Logged-in provider type (e.g., Provider.GOOGLE, Provider.ANONYMOUS, etc.) | O |
- Callback
The following table describes the callback values for membership withdrawal.
| Key | Type | Description |
|---|---|---|
| status | Boolean | Membership withdrawal success status |
Self-authentication with username and password (optional)
This is an authentication method that allows users to log in using their email address and password. It performs user authentication based on the user's email address and password.
Kotlin:
NBase.signInWithPassword(activity, username, password) { user, e ->
if (e != null) {
Log.e("NBase", e.message)
} else {
Log.e("NBase", user)
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.signInWithPassword(activity, username, password, (user, e) -> {
if (e != null) {
Log.e("NBase", "signInWithPassword fail: " + e.getMessage());
} else {
Log.e("NBase", "signInWithPassword success: " + user.toString());
}
return null;
});
Log in with credentials (optional)
Use the following code to log in using credentials (access tokens) obtained from external social accounts.
Kotlin:
NBase.signInWithCredential(activity, Provider.GOOGLE.ToString(), providerToken) { user, e ->
if (e != null) {
Log.e("NBase", e.message)
} else {
Log.e("NBase", user)
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.signInWithCredential(activity, Provider.GOOGLE.toString(), providerToken, (user, e) -> {
if (e != null) {
Log.e("NBase", "signInWithCredential fail: " + e.getMessage());
} else {
Log.e("NBase", "signInWithCredential success: " + user.toString());
}
return null;
});
- Parameter
The following table describes the parameters required for credential login.
| Key | Type | Description | Required |
|---|---|---|---|
| activity | Activity | Current activity | O |
| providerId | Provider | Provider type to integrate | O |
| providerToken | String | Access token of the social account | O |
- Callback
The following table describes the credential login callback values.
| Key | Type | Description |
|---|---|---|
| user | User | User information upon successful login |
| error | Error | Error information upon login failure |
External account integration feature
This section describes the feature that allows you to integrate and manage external social accounts with your GAMEPOT user account.
Use external account integration feature
Use the following code to integrate another social account with your current GAMEPOT user account.
Kotlin:
NBase.createLinking(activity, providerId) { linkingId, e ->
if (e != null) {
Log.e("NBase", "createLinking Fail")
Log.e("NBase", "error.message : " + e.message.toString())
} else {
Log.e("NBase", "createLinking")
Log.e("NBase", "linkingId : " + linkingId.toString())
// Processing logic after successful account integration
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.createLinking(activity, providerId, (linkingId, e) -> {
if (e != null) {
Log.e("NBase", "createLinking Fail");
Log.e("NBase", "error.message : " + e.getMessage());
} else {
Log.e("NBase", "createLinking");
Log.e("NBase", "linkingId : " + linkingId);
// Processing logic after successful account integration
}
return null;
});
- Parameter
The following table describes the parameters required for account integration.
| Key | Type | Description | Required |
|---|---|---|---|
| activity | Activity | Current activity | O |
| providerId | Provider | Provider type to integrate (example: Provider.GOOGLE, Provider.FACEBOOK, etc.) | O |
- Callback
The following table describes the callback values for account integration.
| Key | Type | Description |
|---|---|---|
| linkingId | String | Integration ID returned when integration is successful |
Check integration list
Use the following code to check the list of social accounts currently integrated with your GAMEPOT user account.
Kotlin:
NBase.getLinkedLists { linkings, e ->
if (e != null) {
Log.e("NBase", "getLinkedLists Fail")
Log.e("NBase", "error.message : " + e.message.toString())
} else {
Log.e("NBase", "getLinkedLists")
Log.e("NBase", "linkings : " + linkings.toString())
// Processing logic after checking the integration list
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.getLinkedLists((linkings, e) -> {
if (e != null) {
Log.e("NBase", "getLinkedLists Fail");
Log.e("NBase", "error.message : " + e.getMessage());
} else {
Log.e("NBase", "getLinkedLists");
Log.e("NBase", "linkings : " + linkings.toString());
// Processing logic after checking the integration list
}
return null;
});
- Callback
The following table describes the values provided when checking the account integration list.
| Key | Type | Description |
|---|---|---|
| linkings | List |
List of integrated accounts |
- Linking
The following table describes the fields of the Linking object.
| Key | Type | Description |
|---|---|---|
| id | String | Integration ID (use when removing account integration) |
| username | String | Social ID |
| provider | String | Social provider type |
Remove integration
To remove a specific social account integration from your current GAMEPOT user account, use the following code.
Kotlin:
NBase.deleteLinking(linkingId) { status, e ->
if (e != null) {
Log.e("NBase", "deleteLinking Fail")
Log.e("NBase", "error.message : " + e.message.toString())
} else {
Log.e("NBase", "deleteLinking")
Log.e("NBase", "status : " + status.toString())
// Processing logic after successful integration removal
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.deleteLinking(linkingId, (status, e) -> {
if (e != null) {
Log.e("NBase", "deleteLinking Fail");
Log.e("NBase", "error.message : " + e.getMessage());
} else {
Log.e("NBase", "deleteLinking");
Log.e("NBase", "status : " + status.toString());
// Processing logic after successful integration removal
}
return null;
});
- Parameter
The following table describes the parameters required for account integration removal.
| Key | Type | Description | Required |
|---|---|---|---|
| linkingId | String | Integration ID to remove (obtained from createLinking or getLinkedLists) | O |
- Callback
The following table describes the callback values for account integration removal.
| Key | Type | Description |
|---|---|---|
| status | Boolean | Integration removal success status |
Check app status
Use the following code to check the client's current maintenance/update status.
Kotlin:
NBase.checkAppStatus(activity) { status, error ->
when (status) {
is NBaseAppStatus.Maintenance -> {
// Maintenance
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, status) { popupStatus, e ->
// Popup handling
}
*/
}
is NBaseAppStatus.Update -> {
// Update
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
NBase.showAppStatusPopup(activity, status) { popupStatus, e ->
// Popup handling
}
*/
}
null -> {
// AppStatus Success or Error
if (error != null) {
Log.e("NBase", "checkAppStatus error: $error")
} else {
Log.e("NBase", "checkAppStatus success")
}
}
}
}
Java:
NBase nBase = NBase.INSTANCE;
nBase.checkAppStatus(activity, (status, error) -> {
if (status instanceof NBaseAppStatus.Maintenance) {
// Maintenance
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
nBase.showAppStatusPopup(activity, status, (popupStatus, e) -> {
// Popup handling
});
*/
} else if (status instanceof NBaseAppStatus.Update) {
// Update
/* case 1: Use in-game popup implemented directly by the developer
case 2: Call the code below to use the SDK's own popup
nBase.showAppStatusPopup(activity, status, (popupStatus, e) -> {
// Popup handling
});
*/
} else if (status == null) {
// AppStatus Success or Error
if (error != null) {
Log.e("NBase", "checkAppStatus error: " + error.toString());
} else {
Log.e("NBase", "checkAppStatus success");
}
}
return null;
});
Troubleshooting
This section provides information on common errors and how to resolve them.
Q. An error occurs on Android indicating that the androidx.security.crypto.MasterKeys class cannot be found.
A. This error occurred because the MasterKeys class could not be found. Add the following dependencies to the build.gradle or build.gradle.kts file.
Groovy:
implementation("androidx.security:security-crypto:1.0.0")
Q. I’m getting the error 10: Developer console is not set up correctly. when logging in with Google.
A. Verify that the OAuth 2.0 client ID and client secret for the web application registered in the Google Cloud Console have been entered correctly in the GAMEPOT dashboard.
Q. I’m getting the error 16: Cannot find a matching credential. when logging in with Google.
A. Verify that the package name of the OAuth 2.0 Android client registered in the Google Cloud Console matches the app’s SHA-1 value.