Skip to content

Commit

Permalink
♻️ Update push handler session management
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed May 6, 2024
1 parent 5363bc4 commit 0697da9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Sources/AppcuesKit/Push/PushMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,12 @@ internal class PushMonitor: PushMonitoring {
return false
}

// If there's a user ID mismatch, don't do anything with the notification
guard parsedNotification.userID == storage.userID else {
// If there's no active session or a user ID mismatch, don't do anything with the notification
guard appcues.isActive && parsedNotification.userID == storage.userID else {
completionHandler()
return true
}

// If no session, start one for the user in the notification
if !appcues.isActive {
storage.userID = parsedNotification.userID
storage.isAnonymous = false
}

let analyticsPublisher = appcues.container.resolve(AnalyticsPublishing.self)
analyticsPublisher.publish(TrackingUpdate(
type: .event(name: Events.Push.pushOpened.rawValue, interactive: false),
Expand Down

0 comments on commit 0697da9

Please sign in to comment.