Initializes a reporter with extended configuration.
The configuration of the reporter should be initialized before the first call to the reporter. Otherwise, the configuration of the reporter is ignored.
The reporter should be activated with the configuration using a different API key instead of the app's API key.
Parameters:
with
The instance of the ReporterConfiguration class which contains the extended configuration for the reporter.
The session duration depends on specified timeout. If the time interval between pausing and resuming the session is less than the specified timeout, the current session will be resumed; otherwise, a new one will be created.
To initialize a reporter with the extended configuration, use the activateReporter(with:) method. The configuration of the reporter should be initialized before the first call to the reporter. Otherwise, the configuration of the reporter is ignored.
Parameters:
for
An API key that differs from the app's API key.
Returns:
The instance that implements the AppMetricaReporting protocol for the specified API key.
An array of identification keys for the query. See StartupKey.
on
Queue for sending a block. If the value is zero, the main queue is used.
completion
The block will be sent when available IDs appear or in case of an error.
If they are available at the time of calling, the block is sent immediately. See the AMAIdentifiersCompletionBlock definition for more information about the returned types.
Queue for sending a block. If the value is zero, the main queue is used.
completion
The block will be sent when available IDs appear or in case of an error.
Predefined IDs are:
StartupKey.uuidKey
StartupKey.deviceIDHashKey
StartupKey.deviceIDKey
If they are available at the time of calling, the block is sent immediately. See the AMAIdentifiersCompletionBlock definition for more information about the returned types.
Resumes the session, or creates a new one if the session timeout has expired.
Note
The session duration depends on specified timeout. If the time interval between pausing and resuming the session is less than the specified timeout, the current session will be resumed; otherwise, a new one will be created.
AppMetrica SDK does not send an event immediately after it occurred. The library stores event data in the buffer. The sendEventsBuffer() method sends data from the buffer and flushes it. Use the method to force sending stored events after passing important checkpoints of user scenarios.
Alert
Frequent use of the method can lead to increased outgoing internet traffic and energy consumption.
Adds a JavaScript interface with the AppMetrica name in a window to the specified webview. This lets you send client events from JavaScript code.
Notes:
The method must be called from the main queue.
The method is not available on tvOS.
Call this method before loading any content. We recommend calling this method before creating a webview and before adding your scripts to WKUserContentController.
For more information, see Usage examples.
Parameters:
with
The JSControlling instance.
onFailure
A callback method to be called in the event of an error.
var isAccurateLocationTrackingEnabled: Bool { get; set; }
Controls the accuracy of location tracking used by the internal location manager.
If set to true, the location manager attempts to use the most accurate location data available.
This property takes effect only if the isLocationTrackingEnabled parameter is set to true, and the location
wasn't set manually using the customLocation property.
Use this property to check whether AppMetrica has already been activated, typically to avoid redundant activation calls or to make sure that statistics collection is running.