Intercom and thread updates
This commit is contained in:
@ -44,6 +44,7 @@ public final class Authenticator: ObservableObject {
|
||||
isLoggedIn = false
|
||||
}
|
||||
|
||||
@MainActor
|
||||
public func logout(dataService: DataService, isAccountDeletion: Bool = false) {
|
||||
dataService.resetLocalStorage()
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import Foundation
|
||||
import PostHog
|
||||
#endif
|
||||
|
||||
@MainActor
|
||||
public enum EventTracker {
|
||||
#if os(iOS)
|
||||
public static var posthog: PHGPostHog? = {
|
||||
|
||||
@ -47,9 +47,11 @@ private let logger = Logger(subsystem: "app.omnivore", category: "app-delegate")
|
||||
Intercom.setApiKey(intercomKeys.apiKey, forAppId: intercomKeys.appID)
|
||||
|
||||
if let userId = UserDefaults.standard.string(forKey: Keys.userIdKey) {
|
||||
Intercom.registerUser(withUserId: userId)
|
||||
let userAttributes = ICMUserAttributes()
|
||||
userAttributes.userId = userId
|
||||
Intercom.loginUser(with: userAttributes)
|
||||
} else {
|
||||
Intercom.registerUnidentifiedUser()
|
||||
Intercom.loginUnidentifiedUser()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user