Documentação · Integração com iOS
6. Eventos e logs do AKS
6.1 Logs e eventos
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_. Observe o sublinhado no final de description_ — ele é intencional, não um erro de digitação: evita conflitos com a propriedade description de NSObject/CustomStringConvertible.