Apps Kit SDK logoApps Kit SDK
Docs · iOS Integration

6. AKS Events and logs

6.1 Logging and events

swift
// Free-form debug log
AKSLogManager.shared.log(type: AppsKitSDKLogType.info, message: "Sync finished")

// Named log with a name + type + message
AKSLogManager.shared.log(name: "MyTag", type: AppsKitSDKLogType.warning, message: "Cache stale")

// AKS event tied to a screen context
AKSLogManager.shared.log(context: PlatformContext(delegate: nil), eventName: "e_home_btn_save")

// Same thing, built from screenId/eventType/name instead of a hand-rolled string
AKSLogManager.shared.log(
    context: PlatformContext(delegate: viewController),
    eventName: AKSEventCreator.shared.createEvent(screenId: screenId, eventType: AppsKitSDKEventType.screen, name: name)
)

// Fire a named Firebase event with parameters, from anywhere
AKSLogManager.shared.sendEvent(eventName: "custom_event_name", params: ["key": "value"])

// Purchase / subscription events
AKSLogManager.shared.sendPurchaseEvent(
    context: PlatformContext(delegate: nil),
    purchaseType: PurchaseType.subscription, // or .inApp
    productId: "premium_monthly",
    price: 4.99,
    currency: "USD",
    receiptId: receipt,
    uniqueTransactionId: transactionId,
    startDate: startDateIso,
    endDate: endDateIso
)

// Ad impression / mediation revenue logging
AKSLogManager.shared.logImpression(
    adUnit: adUnitId, adNetwork: "admob", adFormat: "interstitial",
    revenue: revenueString, currency: "USD",
    mediationABTestName: nil, mediationABTestVariant: nil
)

// SDK build/version banner
AKSLogManager.shared.logAarVersion()

AppsKitSDKLogType: .info, .error, .verbose, .warning, .description_. Note the trailing underscore on description_ — that's intentional, not a typo: it avoids colliding with NSObject/CustomStringConvertible's own description property.