Skip to content

Commit

Permalink
πŸ”Š Add push action handler logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed May 6, 2024
1 parent 2f814e9 commit 6aa90d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/AppcuesKit/Push/PushMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal protocol PushMonitoring: AnyObject {
internal class PushMonitor: PushMonitoring {

private weak var appcues: Appcues?
private let config: Appcues.Config
private let storage: DataStoring

private(set) var pushAuthorizationStatus: UNAuthorizationStatus = .notDetermined
Expand All @@ -41,6 +42,7 @@ internal class PushMonitor: PushMonitoring {

init(container: DIContainer) {
self.appcues = container.owner
self.config = container.resolve(Appcues.Config.self)
self.storage = container.resolve(DataStoring.self)

refreshPushStatus()
Expand Down Expand Up @@ -75,6 +77,8 @@ internal class PushMonitor: PushMonitoring {

// `completionHandler` should be called iff the function returns true.
func didReceiveNotification(userInfo: [AnyHashable: Any], completionHandler: @escaping () -> Void) -> Bool {
config.logger.info("Push response received:\n%{private}@", userInfo.description)

guard let parsedNotification = ParsedNotification(userInfo: userInfo) else {
// Not an Appcues push
return false
Expand Down

0 comments on commit 6aa90d9

Please sign in to comment.