Gamebase SDK for Android
2.41.0
NHN Cloud Gamebase Platform
|
This class is a wrapper class that is provided to use various features of Gamebase platform. More...
Classes | |
class | Analytics |
class | Contact |
This class provides wrapping of function execution related to TOAST Contact. More... | |
class | ImageNotice |
This class provides functionality related to image notices. More... | |
class | Launching |
This class is provided to check information such as launch information, status, and so on. More... | |
class | Logger |
class | Network |
This class provides network status information. More... | |
class | Purchase |
This class provides wrapping of function execution related to payment. More... | |
class | Push |
This class provides wrapping of function execution related to push notification. More... | |
class | TemporaryWithdrawal |
This class provides functionality related to temporary withdrawal. More... | |
class | Terms |
This class provides functionality related to terms of use view. More... | |
class | Util |
This class provides Android utility functions. More... | |
class | WebView |
This class implements the Webview call function. More... | |
Static Public Member Functions | |
static void | activeApp (final Context applicationContext) |
Notifies the Gamebase SDK that the app has launched. More... | |
static void | initialize (final Activity activity, final GamebaseConfiguration configuration, @Nullable final GamebaseDataCallback< LaunchingInfo > callback) |
This function initializes the Gamebase SDK. More... | |
static boolean | isInitialized () |
Check whether the Gamebase is initialized. More... | |
static boolean | isSuccess (@Nullable final GamebaseException exception) |
Returns true if the GamebaseException object is null or the error code is zero. More... | |
static boolean | isDebugMode () |
Indicates if we are in debug mode. More... | |
static void | setDebugMode (boolean enableDebug) |
Used to enable or disable logging, and other debug features. More... | |
static String | getSDKVersion () |
Returns the current version of the Gamebase SDK for Android as a string. More... | |
static boolean | isSandbox () |
Returns whether this project is sandbox mode or not. More... | |
static void | login (@NonNull final Activity activity, final String providerName, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Logs the user in with the external authentication provider. More... | |
static void | login (@NonNull final Activity activity, final String providerName, @Nullable Map< String, Object > additionalInfo, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Logs the user in with the external authentication provider. More... | |
static void | login (@NonNull final Activity activity, @NonNull final Map< String, Object > credentialInfo, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Logs the user in with the credential of external authentication provider. More... | |
static void | loginForLastLoggedInProvider (@NonNull final Activity activity, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Logs the user in with last logged in authentication provider. More... | |
static void | addMapping (@NonNull final Activity activity, @NonNull final String providerName, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Mapping the currently authenticated user identifier of Gamebase with another external authentication. More... | |
static void | addMapping (@NonNull final Activity activity, @NonNull final String providerName, @Nullable final Map< String, Object > additionalInfo, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Mapping the currently authenticated user identifier of Gamebase with another external authentication. More... | |
static void | addMapping (@NonNull final Activity activity, @NonNull final Map< String, Object > credentialInfo, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Mapping the currently authenticated user identifier of Gamebase with the credential of external authentication provider. More... | |
static void | changeLogin (@NonNull final Activity activity, @NonNull final ForcingMappingTicket forcingMappingTicket, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Change logged in account with ForcingMappingTicket. More... | |
static void | addMappingForcibly (@NonNull final Activity activity, @NonNull final ForcingMappingTicket forcingMappingTicket, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider. More... | |
static void | addMappingForcibly (@NonNull final Activity activity, @NonNull final String providerName, @NonNull final String forcingMappingKey, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider. More... | |
static void | addMappingForcibly (@NonNull final Activity activity, @NonNull final String providerName, @NonNull final String forcingMappingKey, @Nullable final Map< String, Object > additionalInfo, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider. More... | |
static void | addMappingForcibly (@NonNull final Activity activity, @NonNull final Map< String, Object > credentialInfo, @NonNull final String forcingMappingKey, @Nullable final GamebaseDataCallback< AuthToken > callback) |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider. More... | |
static void | removeMapping (@NonNull final Activity activity, @NonNull final String providerName, @Nullable final GamebaseCallback callback) |
Removes external authentication that is mapped to the current user identifier. More... | |
static void | logout (@NonNull final Activity activity, @Nullable final GamebaseCallback callback) |
Logs out the user. More... | |
static void | withdraw (@NonNull final Activity activity, @Nullable final GamebaseCallback callback) |
Withdraws the user. More... | |
static void | queryTransferAccount (final GamebaseDataCallback< TransferAccountInfo > callback) |
Try to query the transfer account to Gamebase. More... | |
static void | issueTransferAccount (final GamebaseDataCallback< TransferAccountInfo > callback) |
Try to issue the transfer account. More... | |
static void | renewTransferAccount (final TransferAccountRenewConfiguration configuration, final GamebaseDataCallback< TransferAccountInfo > callback) |
Try to renew the transfer account. More... | |
static void | transferAccountWithIdPLogin (final String accountId, final String accountPassword, final GamebaseDataCallback< AuthToken > callback) |
Try to transfer account with transfer account id and password. More... | |
static String | getUserID () |
Gets the user ID that is currently logged in. More... | |
static String | getAccessToken () |
Gets the access token for the current user. More... | |
static String | getLastLoggedInProvider () |
Gets the name of the last logged-in authentication provider. More... | |
static List< String > | getAuthMappingList () |
Gets the list of external authentication providers mapped to the current user identifier. More... | |
static String | getAuthProviderUserID (@NonNull String providerName) |
Gets the user ID from the authentication provider. More... | |
static String | getAuthProviderAccessToken (@NonNull String providerName) |
Gets the access token from the authentication provider. More... | |
static AuthProviderProfile | getAuthProviderProfile (@NonNull String providerName) |
Gets the profile from the authentication provider. More... | |
static BanInfo | getBanInfo () |
Gets the ban information of the suspended user. More... | |
static String | getDeviceLanguageCode () |
Gets the language code set for the current device. More... | |
static String | getDisplayLanguageCode () |
Gets the display language code set for the current device. More... | |
static void | setDisplayLanguageCode (String displayLanguageCode) |
static String | getCarrierCode () |
Gets the carrier code set for the current device. More... | |
static String | getCarrierName () |
Gets the carrier name set for the current device. More... | |
static String | getCountryCode () |
Gets the country code. More... | |
static String | getCountryCodeOfUSIM () |
Gets the country code set in USIM. More... | |
static String | getCountryCodeOfDevice () |
Gets the country code currently set on the device. More... | |
static void | onActivityResult (int requestCode, int resultCode, Intent data) |
The method that should be called from the Activity's or Fragment's onActivityResult method. More... | |
static void | addEventHandler (GamebaseEventHandler handler) |
Add a Gamebase event handler to be called when every events are arrived. More... | |
static void | removeEventHandler (GamebaseEventHandler handler) |
Remove a Gamebase event listener. More... | |
static void | removeAllEventHandler () |
Remove all Gamebase event listeners. More... | |
static void | addServerPushEvent (ServerPushEvent event) |
Add a server push event listener to be called when server push message is arrived. More... | |
static void | removeServerPushEvent (ServerPushEvent event) |
Remove a server push event listener. More... | |
static void | removeAllServerPushEvent () |
Remove all server push event listeners. More... | |
static void | addObserver (Observer observer) |
Add a observer to be called when network status, launching status or user status is changed. More... | |
static void | removeObserver (Observer observer) |
Remove a observer listener. More... | |
static void | removeAllObserver () |
Remove all observer listeners. More... | |
This class is a wrapper class that is provided to use various features of Gamebase platform.
Provides functions such as authentication, launching, pushing, and billing.
|
static |
Notifies the Gamebase SDK that the app has launched.
It should be called as early as possible.
Because of release 2.6.0, GamebaseInitProvider call the API automatically, You do not need to call the API.
applicationContext | The application context. |
NullPointerException | 'applicationContext' is null. |
IllegalStateException | 'android.permission.INTERNET' permission is not defined in AndroidManifest.xml |
Example Usage:
|
static |
Add a Gamebase event handler to be called when every events are arrived.
You have to convert the message data to VO below according to the category value.
GamebaseEventCategory.LOGGED_OUT : GamebaseEventLoggedOutData GamebaseEventCategory.SERVER_PUSH_APP_KICKOUT_MESSAGE_RECEIVED : GamebaseEventServerPushData GamebaseEventCategory.SERVER_PUSH_APP_KICKOUT : GamebaseEventServerPushData GamebaseEventCategory.SERVER_PUSH_TRANSFER_KICKOUT : GamebaseEventServerPushData GamebaseEventCategory.OBSERVER_LAUNCHING : GamebaseEventObserverData GamebaseEventCategory.OBSERVER_HEARTBEAT : GamebaseEventObserverData GamebaseEventCategory.OBSERVER_NETWORK : GamebaseEventObserverData GamebaseEventCategory.PURCHASE_UPDATED : PurchasableReceipt GamebaseEventCategory.PUSH_RECEIVED_MESSAGE : PushMessage GamebaseEventCategory.PUSH_CLICK_MESSAGE : PushMessage GamebaseEventCategory.PUSH_CLICK_ACTION : PushAction
LOGGED_OUT : This event is fired when the Gamebase Access Token expires and the user is logged out. SERVER_PUSH : Receive messages from the Gamebase server. OBSERVER : This is an event that fires when the launch, login account(hearbeat), or network connection 'status changes'. PURCHASE_UPDATED : Promotion payment events can be received. PUSH_RECEIVED_MESSAGE : This event operates when a Push message is received. It has a 'isForeground' boolean value in the extras field. PUSH_CLICK_MESSAGE : This event is executed when the Push message is clicked. Note that there is no 'isForeground' boolean value. PUSH_CLICK_ACTION : This is an event that is triggered when the action button added through the rich message function is clicked.
handler | The listener that will run. |
Example Usage:
|
static |
Mapping the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
activity | The activity which is starting the login process. |
credentialInfo | The credentialInfo which is credential of authentication provider. |
callback | Mapping result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Mapping the currently authenticated user identifier of Gamebase with another external authentication.
activity | The activity which is starting the mapping process. |
providerName | The providerName which is authentication provider. |
callback | Mapping result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Mapping the currently authenticated user identifier of Gamebase with another external authentication.
activity | The activity which is starting the mapping process. |
providerName | The providerName which is authentication provider. |
additionalInfo | The additionalInfo which is additional information using for mapping. |
callback | Callbacks the results of mappings, returns the authentication token as a result of mappings. |
Example Usage:
|
static |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
activity | The activity which is starting the login process. |
forcingMappingTicket | The mapping information which is necessary to map forcibly with the provider that is already mappped with another account. |
callback | Resume mapping result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
activity | The activity which is starting the login process. |
credentialInfo | The credentialInfo which is credential of authentication provider. |
forcingMappingKey | The key string which is necessary to map forcibly with the provider that is already mappped with another account. |
callback | Mapping Forcibly result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
activity | The activity which is starting the login process. |
providerName | The providerName which is authentication provider. |
forcingMappingKey | The key string which is necessary to map forcibly with the provider that is already mappped with another account. |
callback | Mapping Forcibly result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
activity | The activity which is starting the login process. |
providerName | The providerName which is authentication provider. |
forcingMappingKey | The key string which is necessary to map forcibly with the provider that is already mappped with another account. |
additionalInfo | The additionalInfo which is additional information using for mapping. |
callback | Mapping Forcibly result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Add a observer to be called when network status, launching status or user status is changed.
observer | The callback that will run. |
Example Usage:
|
static |
Add a server push event listener to be called when server push message is arrived.
event | The callback that will run. |
Example Usage:
|
static |
Change logged in account with ForcingMappingTicket.
activity | The activity which is starting the login process. |
forcingMappingTicket | The mapping information which is necessary to log in another account. |
callback | Resume mapping result callback, returns the authentication token as a result of mapping. |
Example Usage:
|
static |
Gets the access token for the current user.
|
static |
Gets the list of external authentication providers mapped to the current user identifier.
|
static |
Gets the access token from the authentication provider.
providerName | The providerName which is authentication provider. |
|
static |
Gets the profile from the authentication provider.
providerName | The providerName which is authentication provider. |
|
static |
Gets the user ID from the authentication provider.
providerName | The providerName which is authentication provider. |
|
static |
Gets the ban information of the suspended user.
|
static |
Gets the carrier code set for the current device.
|
static |
Gets the carrier name set for the current device.
|
static |
Gets the country code.
First, get the country code set in USIM,
and if there is no USIM, get the country code set in the device.
|
static |
Gets the country code currently set on the device.
|
static |
Gets the country code set in USIM.
|
static |
Gets the language code set for the current device.
|
static |
Gets the display language code set for the current device.
|
static |
Gets the name of the last logged-in authentication provider.
|
static |
|
static |
Gets the user ID that is currently logged in.
|
static |
This function initializes the Gamebase SDK.
If this function is not called, the Gamebase SDK function will not work.
activity | The activity which is initializing modules. |
configuration | The configurations required to run the Gamebase SDK. |
callback | Initialization result callback, returns the launching information as a result of initialization. |
Example Usage:
|
static |
Indicates if we are in debug mode.
|
static |
Check whether the Gamebase is initialized.
|
static |
Returns whether this project is sandbox mode or not.
|
static |
Returns true if the GamebaseException object is null or the error code is zero.
exception | The exception that occurred. |
|
static |
Try to issue the transfer account.
callback |
|
static |
Logs the user in with the credential of external authentication provider.
activity | The activity which is starting the login process. |
credentialInfo | The credentialInfo which is credential of authentication provider. |
callback | Login result callback, returns the authentication token as a result of login. |
Example Usage:
|
static |
Logs the user in with the external authentication provider.
activity | The activity which is starting the login process. |
providerName | The provider name witch is authentication provider. |
callback | Login result callback, returns the authentication token as a result of login. |
Example Usage:
|
static |
Logs the user in with the external authentication provider.
activity | The activity which is starting the login process. |
providerName | The providerName which is authentication provider. |
additionalInfo | The additionalInfo which is additional information using for login. |
callback | Login result callback, returns the authentication token as a result of login. |
Example Usage:
|
static |
Logs the user in with last logged in authentication provider.
activity | The activity which is starting the mapping process. |
callback | Login result callback, returns the authentication token as a result of login. |
Example Usage:
|
static |
Logs out the user.
activity | The activity which is starting the mapping process. |
callback | Callbacks the result of logout. |
Example Usage:
|
static |
The method that should be called from the Activity's or Fragment's onActivityResult method.
requestCode | The request code that's received by the Activity or Fragment. |
resultCode | The result code that's received by the Activity or Fragment. |
data | The result data that's received by the Activity or Fragment. |
Example Usage:
|
static |
Try to query the transfer account to Gamebase.
If the transfer account is already issued, it returns.
callback |
|
static |
Remove all Gamebase event listeners.
|
static |
Remove all observer listeners.
|
static |
Remove all server push event listeners.
|
static |
Remove a Gamebase event listener.
handler | The listener that will be removed. |
|
static |
Removes external authentication that is mapped to the current user identifier.
activity | The activity which is starting the mapping process. |
providerName | The providerName which is authentication provider. |
callback | Callbacks the result of removing the mapping. |
Example Usage:
|
static |
Remove a observer listener.
observer | The callback that will be removed. |
|
static |
Remove a server push event listener.
event | The callback that will be removed. |
|
static |
Try to renew the transfer account.
If you want to renew the account automatically or manually, you should pass the proper TransferAccountRenewConfiguration object to the first parameter.
configuration | |
callback |
|
static |
Used to enable or disable logging, and other debug features.
If true, Outputs a log when the log priority is VERBOSE or higher.
If false, Outputs a log when the log priority is WARN or higher.
enableDebug | Debug features (like logging) are enabled if true, disabled if false. |
|
static |
|
static |
Try to transfer account with transfer account id and password.
If this process is finished successfully, it proceeds login process and return AuthToken.
accountId | |
accountPassword | |
callback |
|
static |
Withdraws the user.
activity | The activity which is starting the mapping process. |
callback | Callbacks the result of withdraw. |
Example Usage: