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
-
init(
{required String yandexKey, required String userXKey, String sentryKey = '', DSMetricaUserIdType userIdType = DSMetricaUserIdType.none, bool debugModeSend = false}) → Future< void> -
Initialize DSMetrica. Must call before the first use
yandexKey
- API key of Yandex App MetricauserXKey
- API key of UserXsentryKey
- API key of SentryforceSend
- 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(
AdRevenue 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)
-
reportFirstEvent(
String eventName, {Map< String, Object> ? attributes, int stackSkip = 1}) → void - Send only one event per app lifetime
-
reportScreenOpened(
String screenName, {Map< String, Object> ? attributes}) → Future<void> - Report sceen change to implement Heatmaps functionality in UserX
-
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
-
startUserX(
) → Future< void> - Initialize UserX
-
stopUserX(
) → Future< void> - Stop UserX
-
tryStartUserX(
) → Future< void> - Initialize UserX 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