public interface KongregateAPI
Main Kongregate API object which can be used to access various services such as KongregateServices
or StatServices
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLOUD_GAME
track the subset of analytic data automatically for games with server logic
|
static java.lang.String |
DISABLE_ALL
disables all automatic analyitcs collection
|
static java.lang.String |
ENABLE_ALL
the default enable automatic analytics
|
static java.lang.String |
GUEST_GAME_AUTH_TOKEN
Game auth for a guest
|
static long |
GUEST_USER_ID
User ID for a guest
|
static java.lang.String |
GUEST_USERNAME
Username for a guest
|
static java.lang.String |
KONGREGATE_ADJUST_INSTALL_EVENT_TOKEN |
static java.lang.String |
KONGREGATE_ADJUST_PREFIX |
static java.lang.String |
KONGREGATE_ADJUST_SALE_EVENT_TOKEN |
static java.lang.String |
KONGREGATE_ADJUST_SESSION_EVENT_TOKEN |
static java.lang.String |
KONGREGATE_API_VERSION
Client API version
|
static java.lang.String |
KONGREGATE_OPTION_ADJUST_APP_TOKEN
Adjust Options
|
static java.lang.String |
KONGREGATE_OPTION_ADJUST_ENVIRONMENT |
static java.lang.String |
KONGREGATE_OPTION_ADX_ENABLED
Deprecated.
|
static java.lang.String |
KONGREGATE_OPTION_ADX_UPGRADE
Deprecated.
|
static java.lang.String |
KONGREGATE_OPTION_ALLOW_IMMERSIVE_MODE
Option to disable immersive mode on Android 4.4+ devices.
|
static java.lang.String |
KONGREGATE_OPTION_ANALYTICS_DOMAIN
Option to override the Kong Analytics domain
|
static java.lang.String |
KONGREGATE_OPTION_ANALYTICS_MODE
Option indicating the game logic and players exist on a game server
|
static java.lang.String |
KONGREGATE_OPTION_AUTO_ANALYTICS_FILTER
Option to filter properties or events.
|
static java.lang.String |
KONGREGATE_OPTION_AUTO_PROCESS_DEEP_LINKS
Option to automatically parse deep links and notify adjust re-attributions when activities are launched with
Intent.ACTION_VIEW action and contain URI data. |
static java.lang.String |
KONGREGATE_OPTION_AUTO_REPOSITION
Unity only option.
|
static java.lang.String |
KONGREGATE_OPTION_CRASHLYTICS_LOGGING
Option to have the Kongregate SDK log to Crashlytics logging API.
|
static java.lang.String |
KONGREGATE_OPTION_CRASHLYTICS_USER_KEYS
Option to have the Kongregate SDK use the Crashlytics user keys API.
|
static java.lang.String |
KONGREGATE_OPTION_CUSTOM_PLAYER_ID
Specifies the Player ID to be sent with every event.
|
static java.lang.String |
KONGREGATE_OPTION_DEBUG
Option to control debugging/verbose logging type: Boolean, default: Boolean.FALSE
|
static java.lang.String |
KONGREGATE_OPTION_DEBUG_WEBVIEW
Option to control KitKat WebView debugging type: Boolean, default Boolean.FALSE
|
static java.lang.String |
KONGREGATE_OPTION_DEFAULT_PANEL_TRANSITION
Specify default panel transition to use when the panel is open.
|
static java.lang.String |
KONGREGATE_OPTION_DEFER_ANALYTICS
Option to defer initialization of the Analytics class.
|
static java.lang.String |
KONGREGATE_OPTION_DEFER_GDPR_ALERT
Option to defer the GDPR alert dialog until
MobileServices.GDPR_ALERT_TRIGGER is triggered (MobileServices.trigger(String) (String)}) |
static java.lang.String |
KONGREGATE_OPTION_DELTA_COLLECT_URL
Option to specify the DeltaDNA Collect URL
|
static java.lang.String |
KONGREGATE_OPTION_DELTA_ENGAGE_URL
Option to specify the DeltaDNA Engage URL
|
static java.lang.String |
KONGREGATE_OPTION_DELTA_ENVIRONMENT_KEY
Option to specify the DeltaDNA Environment key
|
static java.lang.String |
KONGREGATE_OPTION_DOMAIN
Option to change the back-end domain, Type: String, default: "m.kongregate.com"
|
static java.lang.String |
KONGREGATE_OPTION_GUILD_CHAT
Enables guild chat functionality if also enabled on the server.
|
static java.lang.String |
KONGREGATE_OPTION_KEEN_PROJECT_ID
Keen options are included for legacy games.
|
static java.lang.String |
KONGREGATE_OPTION_KEEN_WRITE_KEY
Keen options are included for legacy games.
|
static java.lang.String |
KONGREGATE_OPTION_KONG_ANALYTICS_ID
Option to specify the Kongregate Analytics application ID
|
static java.lang.String |
KONGREGATE_OPTION_KONG_ANALYTICS_KEY
Option to specify the Kong Analytics API key
|
static java.lang.String |
KONGREGATE_OPTION_MANAGE_LIFECYCLE
Option to control automatic onPause/onResume calls for API >= 14 type: Boolean, default Boolean.TRUE
|
static java.lang.String |
KONGREGATE_OPTION_PANEL_ORIENTATION_OVERRIDE
Option to override default panel orientation mode ("sensor").
|
static java.lang.String |
KONGREGATE_OPTION_PERSISTENT_WEBVIEW
Enables a persistent WebView rather than creating new WebView instances.
|
static java.lang.String |
KONGREGATE_OPTION_SHOW_SYSTEM_UI
Option to show the system UI when the kongregate panel is up.
|
static java.lang.String |
KONGREGATE_OPTION_STRICT_LIFECYCLE_MODE
Option to enable strict lifecyle tracking.
|
static java.lang.String |
KONGREGATE_OPTION_SUPPORTED_PANEL_EVENTS
Provide a list of panel events your game supports.
|
static java.lang.String |
KONGREGATE_OPTION_SWRVE_API_KEY
Option to specify the SWRVE API key
|
static java.lang.String |
KONGREGATE_OPTION_SWRVE_APP_ID
Option to specify the SWRVE APP ID
|
static java.lang.String |
KONGREGATE_OPTION_TEST_GDPR_ALERT
Set this flag to force the GDPR dialog to always show every time it's checked.
|
static java.lang.String |
KONGREGATE_SWRVE_APP_STORE |
static java.lang.String |
KONGREGATE_SWRVE_APP_VERSION |
static java.lang.String |
KONGREGATE_SWRVE_AUTO_DOWNLOAD |
static java.lang.String |
KONGREGATE_SWRVE_CACHE_DIR |
static java.lang.String |
KONGREGATE_SWRVE_DB_NAME |
static java.lang.String |
KONGREGATE_SWRVE_LANGUAGE |
static java.lang.String |
KONGREGATE_SWRVE_LINK_TOKEN |
static java.lang.String |
KONGREGATE_SWRVE_MAX_DB_SIZE |
static java.lang.String |
KONGREGATE_SWRVE_MAX_EVENTS_PER_FLUSH |
static java.lang.String |
KONGREGATE_SWRVE_PREFIX
SWRVE Options
|
static java.lang.String |
KONGREGATE_SWRVE_SENDER_ID |
static java.lang.String |
KONGREGATE_SWRVE_TALK_ENABLED |
static java.lang.String |
ORIENTATION_LANDSCAPE |
static java.lang.String |
ORIENTATION_LANDSCAPE_SENSOR |
static java.lang.String |
ORIENTATION_PORTRAIT
Panel orientation options.
|
static java.lang.String |
ORIENTATION_PORTRAIT_SENSOR |
Modifier and Type | Method and Description |
---|---|
void |
addEventBundleListener(KongregateEventBundleListener listener)
Adds a KongregateEventBundleListener.
|
void |
addEventListener(KongregateEventListener listener)
Adds an event listener.
|
AnalyticsServices |
analytics() |
java.lang.String |
getApiKey() |
android.content.Context |
getApplicationContext() |
long |
getApplicationId() |
boolean |
isReady() |
MobileServices |
mobile() |
MicrotransactionServices |
mtx() |
void |
onCreate(android.app.Activity activity,
android.os.Bundle savedInstanceState)
Invoke when activity in game that uses the Kongregate API is created
|
void |
onDestroy(android.app.Activity activity)
Invoke when activity in game that uses the Kongregate API is destroyed
|
void |
onLowMemory()
Invoke when activity in game that uses the Kongregate API gets a low memory warning
|
void |
onPause(android.app.Activity context)
Invoke when an activity in game that uses the Native API is paused
|
void |
onPause(android.app.Activity context,
java.util.Map<java.lang.String,java.lang.Object> commonProperties)
Invoke when an activity in game that uses the Native API is paused
|
void |
onPause(android.app.Activity context,
java.lang.String commonPropsJson)
Invoke when an activity in game that uses the Native API is paused
|
void |
onResume(android.app.Activity context)
Invoke when activity in game that uses the Native API resumes
|
void |
onResume(android.app.Activity context,
java.util.Map<java.lang.String,java.lang.Object> commonProperties)
Invoke when an activity in game that uses the Native API is paused
|
void |
onResume(android.app.Activity context,
java.lang.String commonPropsJson)
Invoke when activity in game that uses the Native API resumes
|
java.util.List<KongregateEventBundle> |
pollEventBundles()
Polls for KongregateEventsBundles.
|
java.util.List<java.lang.String> |
pollEvents()
Call to poll for events instead of using a listener.
|
void |
removeEventBundleListener(KongregateEventBundleListener listener)
Remove a KongregateEventBundleListener.
|
void |
removeEventListener(KongregateEventListener listener)
Removes an event listener
|
KongregateServices |
services() |
StatServices |
stats() |
void |
willOpenUrl(android.net.Uri uri)
Invoke when your app is being launched using a deep link and
KONGREGATE_OPTION_AUTO_PROCESS_DEEP_LINKS is false (default for Native API). |
static final java.lang.String KONGREGATE_API_VERSION
Client API version
static final java.lang.String KONGREGATE_OPTION_DOMAIN
Option to change the back-end domain, Type: String, default: "m.kongregate.com"
static final java.lang.String KONGREGATE_OPTION_DEBUG
Option to control debugging/verbose logging type: Boolean, default: Boolean.FALSE
static final java.lang.String KONGREGATE_OPTION_DEBUG_WEBVIEW
Option to control KitKat WebView debugging type: Boolean, default Boolean.FALSE
static final java.lang.String KONGREGATE_OPTION_MANAGE_LIFECYCLE
Option to control automatic onPause/onResume calls for API >= 14 type: Boolean, default Boolean.TRUE
static final java.lang.String KONGREGATE_OPTION_SHOW_SYSTEM_UI
Option to show the system UI when the kongregate panel is up. See http://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int) Type: Boolean, default: Boolean.FALSE
static final java.lang.String KONGREGATE_OPTION_ALLOW_IMMERSIVE_MODE
Option to disable immersive mode on Android 4.4+ devices. By default, the SDK will attempt to enter immersive mode when it is initialized, or when the onResume method is called with a valid Activity. Type: Boolean, default: Boolean.TRUE
static final java.lang.String KONGREGATE_OPTION_KEEN_PROJECT_ID
Keen options are included for legacy games. New games should use Swrve.
Option to set a Keen project ID. Used for tracking analytics. Must also specify KONGREGATE_OPTION_KEEN_WRITE_KEY
static final java.lang.String KONGREGATE_OPTION_KEEN_WRITE_KEY
Keen options are included for legacy games. New games should use Swrve.
Option to set a Keen write key. To be used with KONGREGATE_OPTION_KEEN_PROJECT_ID
static final java.lang.String KONGREGATE_OPTION_ANALYTICS_MODE
Option indicating the game logic and players exist on a game server
static final java.lang.String KONGREGATE_OPTION_DEFER_ANALYTICS
Option to defer initialization of the Analytics class. Use this if you need to collect data before sending initial events, or if you initialize the Kongregate API when your game is started via a Service, BroadcastReceiver, Alarm, etc.
If you use enable this flag, you should manually initialize the Analytics class when appropriate. For example, when your main Activity is created. You can initialize the Analytics system using AnalyticsServices.start(Activity)
Type: Boolean, default: Boolean.FALSE
static final java.lang.String KONGREGATE_OPTION_PERSISTENT_WEBVIEW
Enables a persistent WebView rather than creating new WebView instances. This makes memory usage more stable, and it is recommended you set this value to true for better panel performance. You should only disable this if you are running into problems.
Type: Boolean, default: Boolean.TRUE
static final java.lang.String KONGREGATE_OPTION_GUILD_CHAT
Enables guild chat functionality if also enabled on the server. This flag can be used for testing guild chat before rolling it out in a live release.
Type: Boolean, default: Boolean.FALSE
static final java.lang.String KONGREGATE_OPTION_AUTO_ANALYTICS_FILTER
Option to filter properties or events. A comma delimeted list of field and event names.
@Deprecated static final java.lang.String KONGREGATE_OPTION_ADX_ENABLED
AD-X is no longer included with the SDK
@Deprecated static final java.lang.String KONGREGATE_OPTION_ADX_UPGRADE
AD-X is no longer included with the SDK
static final java.lang.String KONGREGATE_OPTION_SWRVE_APP_ID
Option to specify the SWRVE APP ID
static final java.lang.String KONGREGATE_OPTION_SWRVE_API_KEY
Option to specify the SWRVE API key
static final java.lang.String KONGREGATE_OPTION_DELTA_ENVIRONMENT_KEY
Option to specify the DeltaDNA Environment key
static final java.lang.String KONGREGATE_OPTION_DELTA_COLLECT_URL
Option to specify the DeltaDNA Collect URL
static final java.lang.String KONGREGATE_OPTION_DELTA_ENGAGE_URL
Option to specify the DeltaDNA Engage URL
static final java.lang.String KONGREGATE_OPTION_KONG_ANALYTICS_ID
Option to specify the Kongregate Analytics application ID
static final java.lang.String KONGREGATE_OPTION_KONG_ANALYTICS_KEY
Option to specify the Kong Analytics API key
static final java.lang.String KONGREGATE_OPTION_ANALYTICS_DOMAIN
Option to override the Kong Analytics domain
static final java.lang.String KONGREGATE_OPTION_PANEL_ORIENTATION_OVERRIDE
Option to override default panel orientation mode ("sensor").
static final java.lang.String KONGREGATE_OPTION_DEFAULT_PANEL_TRANSITION
Specify default panel transition to use when the panel is open. This will be used in the place of the OS's default animation. The list of supported custom panel tranitions may be found in MobileServices
) (e.g. MobileServices.PANEL_TRANSITION_SLIDE_FROM_LEFT
)
static final java.lang.String KONGREGATE_OPTION_CRASHLYTICS_LOGGING
Option to have the Kongregate SDK log to Crashlytics logging API. Crashlytics must be integrated to use this option. Default if false.
static final java.lang.String KONGREGATE_OPTION_CRASHLYTICS_USER_KEYS
Option to have the Kongregate SDK use the Crashlytics user keys API. Crashlytics must be integrated to use this option. Default is false.
static final java.lang.String KONGREGATE_OPTION_STRICT_LIFECYCLE_MODE
Option to enable strict lifecyle tracking. When enabled, the Kongregate API must be initialized in your activity's onCreate() method and your onResume()/onPause() methods must invoke the corresponding SDK onResume()/onPause() methods. The default is off for convenience, since many development tools (i.e. Unity) do not provide direct access to activity lifecycle methods. This setting may need to be on for games with complex activity structures, in which multiple activities may be visible at the same time, for session tracking to work properly.
static final java.lang.String KONGREGATE_OPTION_AUTO_REPOSITION
Unity only option. Has no effect on native SDK
static final java.lang.String KONGREGATE_OPTION_AUTO_PROCESS_DEEP_LINKS
Option to automatically parse deep links and notify adjust re-attributions when activities are launched with Intent.ACTION_VIEW
action and contain URI data. Default is OFF for Native API. Unity plugin sets this to TRUE. You may wish to set this to true if you are implementing a plugin. For Native Apps or Apps composed of many activities, you probably want to leave this false and invoke willOpenUrl(android.net.Uri)
directly when using deep links.
static final java.lang.String KONGREGATE_OPTION_SUPPORTED_PANEL_EVENTS
Provide a list of panel events your game supports. The panel may dynamically adjust it's UI based on the events your game supports. The list of panel events that may be fired can be found in MobileServices
(e.g. MobileServices.PANEL_EVENT_GO_TO_GUILDS
.
static final java.lang.String KONGREGATE_OPTION_CUSTOM_PLAYER_ID
Specifies the Player ID to be sent with every event. This value will also be used for the SWRVE User ID. In general this value should not be specified. When not specified, the SDK will generate a UUID to use as the Player ID. For special cases, such as for QA builds, it is sometimes useful to use this option to manually set the Player ID/SWRVE User ID.
This option is only read when the app is first launched. The player ID can not change for a specific install, once it's been set.
This option has no effect if the KONGREGATE_OPTION_ANALYTICS_MODE
is set to CLOUD_GAME
.
static final java.lang.String KONGREGATE_OPTION_DEFER_GDPR_ALERT
Option to defer the GDPR alert dialog until MobileServices.GDPR_ALERT_TRIGGER
is triggered (MobileServices.trigger(String)
(String)})
By default the GDPR Alert dialog will be shown as soon as the SDK detects the user needs to accept the privacy policy. This is typically shortly after the game is launched or returns to the foreground. Use this option to control the moment when the alert dialog may be shown.
static final java.lang.String KONGREGATE_OPTION_TEST_GDPR_ALERT
Set this flag to force the GDPR dialog to always show every time it's checked. This option should only be used while testing your integration to verify the alert does not adversely affect your game. To control when the GDPR alert can appear, use KONGREGATE_OPTION_DEFER_GDPR_ALERT
Be sure to remove this option from production builds
static final java.lang.String KONGREGATE_SWRVE_PREFIX
SWRVE Options
static final java.lang.String KONGREGATE_SWRVE_AUTO_DOWNLOAD
static final java.lang.String KONGREGATE_SWRVE_LANGUAGE
static final java.lang.String KONGREGATE_SWRVE_LINK_TOKEN
static final java.lang.String KONGREGATE_SWRVE_APP_VERSION
static final java.lang.String KONGREGATE_SWRVE_TALK_ENABLED
static final java.lang.String KONGREGATE_SWRVE_APP_STORE
static final java.lang.String KONGREGATE_SWRVE_SENDER_ID
static final java.lang.String KONGREGATE_SWRVE_MAX_DB_SIZE
static final java.lang.String KONGREGATE_SWRVE_DB_NAME
static final java.lang.String KONGREGATE_SWRVE_MAX_EVENTS_PER_FLUSH
static final java.lang.String KONGREGATE_SWRVE_CACHE_DIR
static final java.lang.String KONGREGATE_OPTION_ADJUST_APP_TOKEN
Adjust Options
static final java.lang.String KONGREGATE_OPTION_ADJUST_ENVIRONMENT
static final java.lang.String KONGREGATE_ADJUST_PREFIX
static final java.lang.String KONGREGATE_ADJUST_SALE_EVENT_TOKEN
static final java.lang.String KONGREGATE_ADJUST_SESSION_EVENT_TOKEN
static final java.lang.String KONGREGATE_ADJUST_INSTALL_EVENT_TOKEN
static final java.lang.String ENABLE_ALL
the default enable automatic analytics
static final java.lang.String DISABLE_ALL
disables all automatic analyitcs collection
static final java.lang.String CLOUD_GAME
track the subset of analytic data automatically for games with server logic
static final java.lang.String ORIENTATION_PORTRAIT
Panel orientation options. If not specified, use "sensor"
static final java.lang.String ORIENTATION_PORTRAIT_SENSOR
static final java.lang.String ORIENTATION_LANDSCAPE
static final java.lang.String ORIENTATION_LANDSCAPE_SENSOR
static final long GUEST_USER_ID
User ID for a guest
static final java.lang.String GUEST_USERNAME
Username for a guest
static final java.lang.String GUEST_GAME_AUTH_TOKEN
Game auth for a guest
KongregateServices services()
KongregateServices
implementation, or null if not yet initialized.StatServices stats()
StatServices
implementation, or null if not yet initialized.MicrotransactionServices mtx()
MicrotransactionServices
implementation, or null if not yet initializedMobileServices mobile()
MobileServices
implementation, or null if not yet initialized.AnalyticsServices analytics()
AnalyticsServices
implementation, or null if not yet initialized.boolean isReady()
void addEventBundleListener(KongregateEventBundleListener listener)
Adds a KongregateEventBundleListener. This version of Kongregate event listener includes JSON payloads along with the event. The old method addEventListener(KongregateEventListener)
still works but only receives the event name.
listener
- the listener to addvoid removeEventBundleListener(KongregateEventBundleListener listener)
Remove a KongregateEventBundleListener.
listener
- the listener to removejava.util.List<KongregateEventBundle> pollEventBundles()
Polls for KongregateEventsBundles. This is a new version of Kongregate event includes an event name and JSON payload. The old method pollEvents()
still works, but only includes event names.
After this or pollEvents()
is invoked, the event queue will be cleared out.
void addEventListener(KongregateEventListener listener)
Adds an event listener. This event listener will receive just the event name. If you need access to the JSON payload sometimes includes with the event, use the new addEventBundleListener(KongregateEventBundleListener)
method.
listener
- The listenervoid removeEventListener(KongregateEventListener listener)
Removes an event listener
listener
- The listener to removejava.util.List<java.lang.String> pollEvents()
Call to poll for events instead of using a listener. This will return just the event names. If you need access to the JSON payload sometimes included with the event, use the new pollEventBundles()
method.
android.content.Context getApplicationContext()
void onPause(android.app.Activity context)
Invoke when an activity in game that uses the Native API is paused
context
- The contextvoid onPause(android.app.Activity context, java.lang.String commonPropsJson)
Invoke when an activity in game that uses the Native API is paused
context
- The contextcommonPropsJson
- JSON string containing common properties to update before pausingvoid onPause(android.app.Activity context, java.util.Map<java.lang.String,java.lang.Object> commonProperties)
Invoke when an activity in game that uses the Native API is paused
context
- The contextcommonProperties
- Map containing common properties to update before pausingvoid onResume(android.app.Activity context)
Invoke when activity in game that uses the Native API resumes
context
- The contextvoid onResume(android.app.Activity context, java.lang.String commonPropsJson)
Invoke when activity in game that uses the Native API resumes
context
- The contextcommonPropsJson
- JSON string containing common properties to update before resumingvoid onResume(android.app.Activity context, java.util.Map<java.lang.String,java.lang.Object> commonProperties)
Invoke when an activity in game that uses the Native API is paused
context
- The contextcommonProperties
- Map containing common properties to update before resumingvoid onCreate(android.app.Activity activity, android.os.Bundle savedInstanceState)
Invoke when activity in game that uses the Kongregate API is created
savedInstanceState
- void willOpenUrl(android.net.Uri uri)
Invoke when your app is being launched using a deep link and KONGREGATE_OPTION_AUTO_PROCESS_DEEP_LINKS
is false (default for Native API).
uri
- the URL of the deep link that will open the appvoid onDestroy(android.app.Activity activity)
Invoke when activity in game that uses the Kongregate API is destroyed
void onLowMemory()
Invoke when activity in game that uses the Kongregate API gets a low memory warning
java.lang.String getApiKey()
long getApplicationId()