MessengerTracking

Fire-and-forget adapter around the Mobile Tracking SDK's MobileUserTracker.

Owned by MessengerAccount; the host obtains it via MessengerAccount.initiateTracking and calls events through account.tracking?.someApi(...). All event methods are non-blocking: they launch on an internal SupervisorJob scope and return immediately. Failures are handled inside the tracking SDK and are not surfaced to the host.

Functions

Link copied to clipboard

Clears externalId, the global traits set via setTraits, and getSessionId. App, device, and network metadata set via the other set* methods are left untouched.

Link copied to clipboard
fun customEvent(eventName: String, screenName: String, attributes: Map<String, Any>? = null, traits: TrackingTraits? = null)

Reports a custom event.

Link copied to clipboard

Returns the current tracking session ID, or null if there is none.

Link copied to clipboard
fun screenViewed(screenName: String, attributes: Map<String, Any>? = null, searchQuery: String? = null, traits: TrackingTraits? = null)

Reports that the user viewed a screen.

Link copied to clipboard
fun searchPerformed(screenName: String, attributes: Map<String, Any>? = null, traits: TrackingTraits? = null)

Reports that the user performed a search.

Link copied to clipboard
fun setAppBuildNumber(buildNumber: String)

Sets the build number of the host app. The value is sent with every subsequent event.

Link copied to clipboard
fun setAppName(name: String)

Sets the name of the host app. The value is sent with every subsequent event.

Link copied to clipboard
fun setAppNamespace(namespace: String)

Sets the namespace (for example, the application ID) of the host app. The value is sent with every subsequent event.

Link copied to clipboard
fun setAppVersion(version: String)

Sets the version of the host app. The value is sent with every subsequent event.

Link copied to clipboard
fun setBluetoothEnabled(bluetoothEnabled: Boolean)

Sets whether Bluetooth is enabled on the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setCarrier(carrier: String)

Sets the mobile network carrier of the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setCellularEnabled(cellularEnabled: Boolean)

Sets whether cellular data is enabled on the device. The value is sent with every subsequent event.

Link copied to clipboard

Sets the category of the device. The value is sent with every subsequent event.

Link copied to clipboard

Sets the type of the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setExternalId(externalId: String)

Sets the external identifier of the user, used for identity stitching. The value is sent with every subsequent event.

Link copied to clipboard
fun setFingerprint(fingerprint: String)

Sets the device fingerprint. The value is sent with every subsequent event.

Link copied to clipboard
fun setIsMobile(isMobile: Boolean)

Sets whether the device is a mobile device. The value is sent with every subsequent event.

Link copied to clipboard
fun setManufacturer(manufacturer: String)

Sets the manufacturer of the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setOsFamily(osFamily: String)

Sets the operating system family of the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setOsVersion(osVersion: String)

Sets the operating system version of the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setScreenDensity(screenDensity: Int)

Sets the screen density of the device as a scale factor, where 1 means one physical pixel per device-independent pixel. The value is sent with every subsequent event.

Link copied to clipboard
fun setScreenHeight(screenHeight: Int)

Sets the screen height of the device. The value is sent with every subsequent event.

Link copied to clipboard
fun setScreenWidth(screenWidth: Int)

Sets the screen width of the device. The value is sent with every subsequent event.

Link copied to clipboard

Sets the identity traits sent with every subsequent event.

Link copied to clipboard
fun setWifiEnabled(wifiEnabled: Boolean)

Sets whether Wi-Fi is enabled on the device. The value is sent with every subsequent event.