From e1c6db5cf37d387857db1dbeef9c376d74a5ff2d Mon Sep 17 00:00:00 2001 From: Andrew Sawyer Date: Tue, 15 Apr 2025 09:46:40 -0600 Subject: [PATCH] First pass --- Sources/Aptabase/Aptabase.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Aptabase/Aptabase.swift b/Sources/Aptabase/Aptabase.swift index 207d1d4..e6b605e 100644 --- a/Sources/Aptabase/Aptabase.swift +++ b/Sources/Aptabase/Aptabase.swift @@ -92,13 +92,18 @@ public class Aptabase: NSObject { enqueueEvent(eventName, with: codable) } - /// Forces all queued events to be sent to the server + /// Forces all queued events to be sent to the server asynchronously. Returns before the events have been sent. @objc public func flush() { Task { await self.client?.flush() } } + /// Forces all queued events to be sent to the server. Returns after the events have been sent. + public func flush() async { + await self.client?.flush() + } + private func enqueueEvent(_ eventName: String, with props: [String: AnyCodableValue] = [:]) { guard let client else { return