From 44fe6b4ef7da1cd3bee8f600b0133e4ac6df619b Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Thu, 28 Apr 2022 16:29:22 -0700 Subject: [PATCH] register segment user when app is launched --- .../Sources/App/Views/RootView/RootViewModel.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apple/OmnivoreKit/Sources/App/Views/RootView/RootViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/RootView/RootViewModel.swift index bcbf989d9..0f26b9a92 100644 --- a/apple/OmnivoreKit/Sources/App/Views/RootView/RootViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/RootView/RootViewModel.swift @@ -22,6 +22,10 @@ public final class RootViewModel: ObservableObject { public init() { registerFonts() + if let viewer = services.dataService.currentViewer { + EventTracker.registerUser(userID: viewer.unwrappedUserID) + } + #if DEBUG if CommandLine.arguments.contains("--uitesting") { services.authenticator.logout()