# Gamebase

class Gamebase

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.

## Constructors

Gamebase
Link copied to clipboard
constructor()

## Types

AgeSignals
Link copied to clipboard
class AgeSignals
Analytics
Link copied to clipboard
class Analytics
Community
Link copied to clipboard
class Community
This class provides community webview functionality.
Contact
Link copied to clipboard
class Contact
This class provides service center webview functionality.
GameNotice
Link copied to clipboard
class GameNotice
This class provides game notice webview functionality.
ImageNotice
Link copied to clipboard
class ImageNotice
This class provides functionality related to image notices.
Launching
Link copied to clipboard
class Launching
This class is provided to check information such as launch information, status, and so on.
Logger
Link copied to clipboard
class Logger
Network
Link copied to clipboard
class Network
This class provides network status information.
Purchase
Link copied to clipboard
class Purchase
This class provides wrapping of function execution related to payment.
Push
Link copied to clipboard
class Push
This class provides wrapping of function execution related to push notification.
TemporaryWithdrawal
Link copied to clipboard
class TemporaryWithdrawal
This class provides functionality related to temporary withdrawal.
Terms
Link copied to clipboard
class Terms
This class provides functionality related to terms of use view.
Util
Link copied to clipboard
class Util
This class provides Android utility functions.
WebView
Link copied to clipboard
class WebView
This class implements the Webview call function.

## Functions

activeApp
Link copied to clipboard
open fun activeApp(applicationContext: Context)
Notifies the Gamebase SDK that the app has launched.
addEventHandler
Link copied to clipboard
open fun addEventHandler(handler: GamebaseEventHandler)
Add a Gamebase event handler to be called when every events are arrived.
addMapping
Link copied to clipboard
open fun addMapping(@NonNull activity: Activity, @NonNull providerName: String, @Nullable callback: GamebaseDataCallback<AuthToken>)
open fun addMapping(@NonNull activity: Activity, @NonNull providerName: String, @Nullable additionalInfo: Map<String, Any>, @Nullable callback: GamebaseDataCallback<AuthToken>)
Mapping the currently authenticated user identifier of Gamebase with another external authentication.
open fun addMapping(@NonNull activity: Activity, @NonNull credentialInfo: Map<String, Any>, @Nullable callback: GamebaseDataCallback<AuthToken>)
Mapping the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
addMappingForcibly
Link copied to clipboard
open fun addMappingForcibly(@NonNull activity: Activity, @NonNull forcingMappingTicket: ForcingMappingTicket, @Nullable callback: GamebaseDataCallback<AuthToken>)
open fun addMappingForcibly(@NonNull activity: Activity, @NonNull providerName: String, @NonNull forcingMappingKey: String, @Nullable callback: GamebaseDataCallback<AuthToken>)
open fun addMappingForcibly(@NonNull activity: Activity, @NonNull credentialInfo: Map<String, Any>, @NonNull forcingMappingKey: String, @Nullable callback: GamebaseDataCallback<AuthToken>)
open fun addMappingForcibly(@NonNull activity: Activity, @NonNull providerName: String, @NonNull forcingMappingKey: String, @Nullable additionalInfo: Map<String, Any>, @Nullable callback: GamebaseDataCallback<AuthToken>)
Forcibly trying to map the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
addObserver
Link copied to clipboard
open fun addObserver(observer: Observer)
Add a observer to be called when network status, launching status or user status is changed.
addServerPushEvent
Link copied to clipboard
open fun addServerPushEvent(event: ServerPushEvent)
Add a server push event listener to be called when server push message is arrived.
changeLogin
Link copied to clipboard
open fun changeLogin(@NonNull activity: Activity, @NonNull forcingMappingTicket: ForcingMappingTicket, @Nullable callback: GamebaseDataCallback<AuthToken>)
Change logged in account with ForcingMappingTicket.
getAccessToken
Link copied to clipboard
open fun getAccessToken(): String
Gets the access token for the current user.
getAuthMappingList
Link copied to clipboard
open fun getAuthMappingList(): List<String>
Gets the list of external authentication providers mapped to the current user identifier.
getAuthProviderAccessToken
Link copied to clipboard
open fun getAuthProviderAccessToken(@NonNull providerName: String): String
Gets the access token from the authentication provider.
getAuthProviderProfile
Link copied to clipboard
open fun getAuthProviderProfile(@NonNull providerName: String): AuthProviderProfile
Gets the profile from the authentication provider.
getAuthProviderUserID
Link copied to clipboard
open fun getAuthProviderUserID(@NonNull providerName: String): String
Gets the user ID from the authentication provider.
getBanInfo
Link copied to clipboard
open fun getBanInfo(): BanInfo
Gets the ban information of the suspended user.
getCarrierCode
Link copied to clipboard
open fun getCarrierCode(): String
Gets the carrier code set for the current device.
getCarrierName
Link copied to clipboard
open fun getCarrierName(): String
Gets the carrier name set for the current device.
getCountryCode
Link copied to clipboard
open fun getCountryCode(): String
Gets the country code.
getCountryCodeOfDevice
Link copied to clipboard
open fun getCountryCodeOfDevice(): String
Gets the country code currently set on the device.
getCountryCodeOfUSIM
Link copied to clipboard
open fun getCountryCodeOfUSIM(): String
Gets the country code set in USIM.
getDeviceLanguageCode
Link copied to clipboard
open fun getDeviceLanguageCode(): String
Gets the language code set for the current device.
getDisplayLanguageCode
Link copied to clipboard
open fun getDisplayLanguageCode(): String
Gets the display language code set for the current device.
getLastLoggedInProvider
Link copied to clipboard
@Nullable
open fun getLastLoggedInProvider(): String
Gets the name of the last logged-in authentication provider.
getSDKVersion
Link copied to clipboard
open fun getSDKVersion(): String
Returns the current version of the Gamebase SDK for Android as a string.
getUserID
Link copied to clipboard
open fun getUserID(): String
Gets the user ID that is currently logged in.
initialize
Link copied to clipboard
open fun initialize(activity: Activity, configuration: GamebaseConfiguration, @Nullable callback: GamebaseDataCallback<LaunchingInfo>)
This function initializes the Gamebase SDK.
isDebugMode
Link copied to clipboard
open fun isDebugMode(): Boolean
Indicates if we are in debug mode.
isInitialized
Link copied to clipboard
open fun isInitialized(): Boolean
Check whether the Gamebase is initialized.
isSandbox
Link copied to clipboard
open fun isSandbox(): Boolean
Returns whether this project is sandbox mode or not.
isSuccess
Link copied to clipboard
open fun isSuccess(@Nullable exception: GamebaseException): Boolean
Returns true if the GamebaseException object is null or the error code is zero.
issueTransferAccount
Link copied to clipboard
open fun issueTransferAccount(callback: GamebaseDataCallback<TransferAccountInfo>)
Try to issue the transfer account.
login
Link copied to clipboard
open fun login(@NonNull activity: Activity, providerName: String, @Nullable callback: GamebaseDataCallback<AuthToken>)
open fun login(@NonNull activity: Activity, providerName: String, @Nullable additionalInfo: Map<String, Any>, @Nullable callback: GamebaseDataCallback<AuthToken>)
Logs the user in with the external authentication provider.
open fun login(@NonNull activity: Activity, @NonNull credentialInfo: Map<String, Any>, @Nullable callback: GamebaseDataCallback<AuthToken>)
Logs the user in with the credential of external authentication provider.
loginForLastLoggedInProvider
Link copied to clipboard
open fun loginForLastLoggedInProvider(@NonNull activity: Activity, @Nullable callback: GamebaseDataCallback<AuthToken>)
open fun loginForLastLoggedInProvider(@NonNull activity: Activity, @Nullable additionalInfo: Map<String, Any>, @Nullable callback: GamebaseDataCallback<AuthToken>)
Logs the user in with last logged in authentication provider.
logout
Link copied to clipboard
open fun logout(@NonNull activity: Activity, @Nullable callback: GamebaseCallback)
Logs out the user.
onActivityResult
Link copied to clipboard
open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent)
The method that should be called from the Activity's or Fragment's onActivityResult method.
queryTransferAccount
Link copied to clipboard
open fun queryTransferAccount(callback: GamebaseDataCallback<TransferAccountInfo>)
Try to query the transfer account to Gamebase.
removeAllEventHandler
Link copied to clipboard
open fun removeAllEventHandler()
Remove all Gamebase event listeners.
removeAllObserver
Link copied to clipboard
open fun removeAllObserver()
Remove all observer listeners.
removeAllServerPushEvent
Link copied to clipboard
open fun removeAllServerPushEvent()
Remove all server push event listeners.
removeEventHandler
Link copied to clipboard
open fun removeEventHandler(handler: GamebaseEventHandler)
Remove a Gamebase event listener.
removeMapping
Link copied to clipboard
open fun removeMapping(@NonNull activity: Activity, @NonNull providerName: String, @Nullable callback: GamebaseCallback)
Removes external authentication that is mapped to the current user identifier.
removeObserver
Link copied to clipboard
open fun removeObserver(observer: Observer)
Remove a observer listener.
removeServerPushEvent
Link copied to clipboard
open fun removeServerPushEvent(event: ServerPushEvent)
Remove a server push event listener.
renewTransferAccount
Link copied to clipboard
open fun renewTransferAccount(@NonNull configuration: TransferAccountRenewConfiguration, callback: GamebaseDataCallback<TransferAccountInfo>)
Try to renew the transfer account.
requestLastLoggedInProvider
Link copied to clipboard
open fun requestLastLoggedInProvider(@NonNull callback: GamebaseDataCallback<String>)
Request the name of the last logged-in authentication provider asynchronously.
setDebugMode
Link copied to clipboard
open fun setDebugMode(enableDebug: Boolean)
Used to enable or disable logging, and other debug features.
setDisplayLanguageCode
Link copied to clipboard
open fun setDisplayLanguageCode(@NonNull displayLanguageCode: String)
transferAccountWithIdPLogin
Link copied to clipboard
open fun transferAccountWithIdPLogin(accountId: String, accountPassword: String, callback: GamebaseDataCallback<AuthToken>)
Try to transfer account with transfer account id and password.
withdraw
Link copied to clipboard
open fun withdraw(@NonNull activity: Activity, @Nullable callback: GamebaseCallback)
Withdraws the user.