Analytics

class Analytics @VisibleForTesting constructor(context: Context, dataStore: PreferenceDataStore, runtimeConfig: AirshipRuntimeConfig, privacyManager: PrivacyManager, airshipChannel: AirshipChannel, activityMonitor: ActivityMonitor, localeManager: LocaleManager, executor: Executor, eventManager: EventManager, permissionsManager: PermissionsManager, eventFeed: AirshipEventFeed, clock: Clock = Clock.DEFAULT_CLOCK) : AirshipComponent

This class is the primary interface to the Airship Analytics API.

Constructors

Link copied to clipboard
constructor(context: Context, dataStore: PreferenceDataStore, runtimeConfig: AirshipRuntimeConfig, privacyManager: PrivacyManager, airshipChannel: AirshipChannel, activityMonitor: ActivityMonitor, localeManager: LocaleManager, executor: Executor, eventManager: EventManager, permissionsManager: PermissionsManager, eventFeed: AirshipEventFeed, clock: Clock = Clock.DEFAULT_CLOCK)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns the last stored send Id from when a push conversion was detected.

Link copied to clipboard
val events: SharedFlow<AirshipEventData>

A shared flow of raw event tracked by Airship.

Link copied to clipboard
Link copied to clipboard
val regionState: StateFlow<Set<String>>

The current list of region IDs tracked using com.urbanairship.analytics.location.RegionEvent.

Link copied to clipboard
val screenState: StateFlow<String?>

The name of the screen that is currently being tracked by trackScreen

Link copied to clipboard

Gets the current environment Id.

Functions

Link copied to clipboard
Link copied to clipboard

Edits the currently stored associated identifiers. All changes made in the editor are batched, and not stored until you call apply(). Calling apply() on the editor will associate the identifiers with the device and add an event that will be sent up with other analytics events. See com.urbanairship.analytics.AssociatedIdentifiers.Editor

Link copied to clipboard

Records a region event.

Link copied to clipboard

Records a region event.

Link copied to clipboard

Initiates screen tracking for a specific app screen, must be called once per tracked screen.

Link copied to clipboard

Uploads any pending events. Events are batched and uploaded automatically to conserve battery life. Normally apps should not call this method directly.