diff --git a/Sources/EmbraceCore/Capture/PushNotifications/UNUserNotificationCenterDelegateProxy.swift b/Sources/EmbraceCore/Capture/PushNotifications/UNUserNotificationCenterDelegateProxy.swift index f8c7ba09..f2b1630c 100644 --- a/Sources/EmbraceCore/Capture/PushNotifications/UNUserNotificationCenterDelegateProxy.swift +++ b/Sources/EmbraceCore/Capture/PushNotifications/UNUserNotificationCenterDelegateProxy.swift @@ -12,6 +12,24 @@ class UNUserNotificationCenterDelegateProxy: NSObject { init(captureData: Bool) { self.captureData = captureData } + + override func responds(to aSelector: Selector!) -> Bool { + if super.responds(to: aSelector) { + return true + } else if let originalDelegate = originalDelegate, originalDelegate.responds(to: aSelector) { + return true + } + return false + } + + override func forwardingTarget(for aSelector: Selector!) -> Any? { + if super.responds(to: aSelector) { + return self + } else if let originalDelegate = originalDelegate, originalDelegate.responds(to: aSelector) { + return originalDelegate + } + return nil + } } extension UNUserNotificationCenterDelegateProxy: UNUserNotificationCenterDelegate {