AnalyticsService
public final class AnalyticsService : AnalyticsServiceProtocol
AnalyticsService
is responsible for sending batched analytics events to a server.
It utilizes a session manager to manage network requests and communicates with a configurable API domain.
-
The API domain used for sending analytics event requests. This determines the base URL for API communication.
Declaration
Swift
public var apiDomain: APIDomain
-
Sends a batch of analytics events payload to the server.
- payload: The
AmplitudeEventsBatchPayload
object containing a batch of analytics events to send. completion: A closure called when the request is completed. It provides a
Result
containing either aString
on success or aGiniError
on failure.
Note
Internally, this method delegates the request to
sessionManager
for execution.Declaration
Swift
public func sendEventsPayload(payload: AmplitudeEventsBatchPayload, completion: @escaping CompletionResult<String>)
- payload: The