Apps Kit SDK logoApps Kit SDK
Docs · AppsKitSDK (AKS) — Android Integration Guide

7. AKS Events and logs

7.1 Automatic screen events

If your Activity overrides setScreenNameAndId() (returning a Pair<screenId, screenName>), the base Activity automatically fires a SCREEN event in onCreate() — you don't need to call anything yourself for that.

7.2 Manual events from within an Activity

From inside any Activity extending AppsKitSDKBaseActivity / AppsKitSDKBaseComponentActivity:

kotlin
sendAKSEvent(AppsKitSDKEventType.BUTTON, "SaveClicked")

This builds and logs an event named e_{screenId}_{prefix}_{name} to Firebase Analytics (and the debug log) using the screen ID from setScreenNameAndId().

sendAKSEvent is just a convenience wrapper — it expands to the lines below, which is what you'd call directly from somewhere that doesn't have it available (a Fragment, ViewModel, Composable, or a plain Activity that isn't extending one of the AKS base Activities):

kotlin
AKSLogManager.log(
    PlatformContext(this),
    AKSEventCreator.createEvent(screenId, eventType, name)
)

screenId here is just the Int you'd otherwise get from setScreenNameAndId().first — track/pass it yourself if you're not inside an AKS base Activity.

AppsKitSDKEventType and its Firebase event-name prefix:

Enum constant Prefix
SCREEN SCR
BUTTON BTN
STATUS STS
ITEM ITM
LIST LST
ICON ICO
DIALOG_BTN DLG_BTN
ACTION ACT
TAB TAB
DIALOG DLG

Firebase Analytics caps event names at 40 characters, so keep name short — especially for ITEM/LIST events, which append an index/title to the name.

7.3 General-purpose logging and events

For events outside an Activity's screen scope (services, ViewModels, repositories, etc.), use the plain-Context wrapper AppsKitSDKLogManager:

kotlin
// Free-form debug log (tagged PTB_LOG in Logcat)
AppsKitSDKLogManager.log(AppsKitSDKLogType.INFO, "Sync finished")

// Fire a named Firebase event with parameters, from anywhere
AppsKitSDKLogManager.sendEvent("custom_event_name", mapOf("key" to "value"))

// Purchase / subscription events
AppsKitSDKLogManager.sendPurchaseEvent(
    context = this,
    purchaseType = PurchaseType.SUBSCRIPTION, // or PurchaseType.IN_APP
    productId = "premium_monthly",
    price = 4.99,
    currency = "USD",
    receiptId = receipt,
    uniqueTransactionId = transactionId,
    startDate = startDateIso,
    endDate = endDateIso
)

// SDK build/version banner in Logcat
AppsKitSDKLogManager.logAarVersion()

AppsKitSDKLogType: INFO, ERROR, VERBOSE, WARNING, DESCRIPTION.

7.4 Debug log tags

Filter Logcat by:

  • PTB_LOG — general SDK logs
  • PTB_LOG_ADS — ad load/show lifecycle
  • PTB_LOG_ANALYTICS — events sent to Firebase/MMPs