mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Intercom and thread updates
This commit is contained in:
parent
7ac3729a72
commit
47727f1321
3 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue