diff --git a/apple/OmnivoreKit/Sources/Services/Authentication/GoogleAuth.swift b/apple/OmnivoreKit/Sources/Services/Authentication/GoogleAuth.swift index 89324e140..651e5d66e 100644 --- a/apple/OmnivoreKit/Sources/Services/Authentication/GoogleAuth.swift +++ b/apple/OmnivoreKit/Sources/Services/Authentication/GoogleAuth.swift @@ -10,6 +10,7 @@ public enum GoogleAuthResponse { } extension Authenticator { + @MainActor public func handleGoogleAuth(presentingVC: PlatformViewController?) async -> GoogleAuthResponse { let idToken = await withCheckedContinuation { continuation in googleSignIn(presenting: presentingVC) { continuation.resume(returning: $0) } diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Queries/ViewerFetcher.swift b/apple/OmnivoreKit/Sources/Services/DataService/Queries/ViewerFetcher.swift index c386b991d..38223fe41 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Queries/ViewerFetcher.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Queries/ViewerFetcher.swift @@ -82,7 +82,6 @@ public struct ViewerInternal { do { try context.save() - EventTracker.registerUser(userID: userID) logger.debug("Viewer saved succesfully") } catch { context.rollback() @@ -90,5 +89,8 @@ public struct ViewerInternal { throw error } } + DispatchQueue.main.async { + EventTracker.registerUser(userID: userID) + } } }