DSMetrica class abstract
You must call await DSMetrica.init() at the app start
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- userIdType → DSMetricaUserIdType
-
no setter
- yandexId → String
-
no setter
Static Methods
-
addPersistentAttrs(
Map< String, Object> attrs) → void - Save attributes to send it in every reportEvent
-
getDeviceId(
) → Future< String> - Get legacy device id. Recommended to use other ID instead
-
init(
{required String yandexKey, required String uxCamKey, DSMetricaUserIdType userIdType = DSMetricaUserIdType.none, bool debugModeSend = false}) → Future< void> -
Initialize DSMetrica. Must call before the first use
yandexKey
- API key of Yandex App MetricauxCamKey
- API key of UXCamforceSend
- send events in debug mode too -
putErrorEnvironmentValue(
String key, String? value) → Future< void> -
Adds a
key
-value
pair to or deletes it from the application error environment. The environment is shown in the crash and error report. -
registerAttrsHandler(
DSMetricaAttrsCallback handler) → void -
Add
handler
to calculate attributes to send it in every reportEvent -
reportAdRevenue(
AppMetricaAdRevenue revenue) → Future< void> - AppMetrica wrapper
-
reportError(
{String? message, AppMetricaErrorDescription? errorDescription}) → Future< void> - AppMetrica wrapper
-
reportEvent(
String eventName, {bool fbSend = false, Map< String, Object> ? attributes, Map<String, Object> ? fbAttributes, int stackSkip = 1, EventSendingType eventSendingType = EventSendingType.everyTime}) → void - Report event to AppMetrica and UserX (disabled in debug mode)
-
reportEventWithMap(
String eventName, Map< String, Object> ? attributes, {bool fbSend = false, Map<String, Object> ? fbAttributes, int stackSkip = 1, EventSendingType eventSendingType = EventSendingType.everyTime}) → Future<void> - Report event to AppMetrica and UserX (disabled in debug mode)
-
reportScreenOpened(
String? screenName, {Map< String, Object> ? attributes}) → Future<void> - Report screen change to implement Heatmaps functionality in UserX It removes all chars since ? and # (keep just path without queue and anchor)
-
reportUserProfile(
UserProfile userProfile) → Future< void> - AppMetrica wrapper
-
sendYandexDeviceId(
) → Future< void> - Send yandex Id to Firebase if it was not send
-
setPersistentAttrsHandler(
DSMetricaAttrsCallback handler) → void - Calculate attributes to send it in every reportEvent
-
setUserProfileID(
String userProfileID) → Future< void> - Set user profile ID
-
startUXCam(
) → Future< void> - Initialize UXCam
-
stopUXCam(
) → Future< void> - Stop UXCam
-
tryStartUXCam(
) → Future< void> - Initialize UXCam if it is allowed by RemoteConfig
-
tryUpdateAppSessionId(
) → void - Call this method on app start and AppLifecycleState.resumed
-
unregisterAttrsHandler(
DSMetricaAttrsCallback handler) → void -
Remove
handler
which was added by registerAttrsHandler -
userProfileID(
) → String? - Get user profile ID which was initialized in current session