AppMetrica class

The class contains methods for working with the library.

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

deviceId Future<String?>
Returns deviceId
no setter
libraryApiLevel Future<int>
Returns the API level of the library (Android).
no setter
libraryVersion Future<String>
Returns the current version of the AppMetrica library.
no setter
uuid Future<String?>
no setter

Static Methods

activate(AppMetricaConfig config) Future<void>
Initializes the library in the application with the initial configuration config.
activateReporter(ReporterConfig config) Future<void>
Activates reporter with the config configuration.
clearAppEnvironment() Future<void>
enableActivityAutoTracking() Future<void>
getReporter(String apiKey) Reporter
Returns an object that implements the Reporter interface for the specified apiKey.
pauseSession() Future<void>
Suspends the current foreground session.
putAppEnvironmentValue(String key, String? value) Future<void>
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.
reportAdRevenue(AdRevenue adRevenue) Future<void>
Sends information about ad revenue.
reportAppOpen(String deeplink) Future<void>
Sends a message about opening the application using deeplink.
reportECommerce(ECommerceEvent event) Future<void>
Sends a message about an e-commerce event.
reportError({String? message, AppMetricaErrorDescription? errorDescription}) Future<void>
Sends an error message message with the description errorDescription. If there is no errorDescription description, the current stacktrace will be automatically added.
reportErrorWithGroup(String groupId, {AppMetricaErrorDescription? errorDescription, String? message}) Future<void>
Sends an error message with its own identifier groupId. Errors in reports are grouped by it.
reportEvent(String eventName) Future<void>
Sends an event message with a short name or description of the event eventName.
reportEventWithJson(String eventName, String? attributesJson) Future<void>
Sends an event message in JSON format attributesJson as a string and a short name or description of the event eventName.
reportEventWithMap(String eventName, Map<String, Object>? attributes) Future<void>
Sends an event message as a set of attributes attributes Map and a short name or description of the event eventName.
reportReferralUrl(String referralUrl) Future<void>
Sets the referralUrl of the application installation.
reportRevenue(Revenue revenue) Future<void>
Sends the purchase information to the AppMetrica server.
reportUnhandledException(AppMetricaErrorDescription errorDescription) Future<void>
Sends an event with an unhandled exception errorDescription.
reportUserProfile(UserProfile userProfile) Future<void>
Sends information about updating the user profile using the userProfile parameter.
Requests a deferred deeplink.
requestDeferredDeeplinkParameters() Future<Map<String, String>>
Requests deferred deeplink parameters.
requestStartupParams(List<String>? params) Future<StartupParams>
resumeSession() Future<void>
Resumes the foreground session or creates a new one if the session timeout has expired.
runZoneGuarded(VoidCallback callback) → void
Runs callback in its own error zone created by runZonedGuarded, and reports all exceptions to AppMetrica.
sendEventsBuffer() Future<void>
Sends saved events from the buffer.
setDataSendingEnabled(bool enabled) Future<void>
Enables/disables sending statistics to the AppMetrica server.
setLocation(Location? location) Future<void>
Sets its own device location information using the location parameter.
setLocationTracking(bool enabled) Future<void>
Enables/disables sending device location information using the enabled. The default value for Android is false, for iOS is true.
setUserProfileID(String? userProfileID) Future<void>
Sets the ID for the user profile using the userProfileID parameter.