From eb4720a5dc29ae4adb5cfd19f312d6f2e1e05212 Mon Sep 17 00:00:00 2001 From: Ignacio Tischelman Date: Tue, 5 Nov 2024 13:05:38 -0300 Subject: [PATCH] Attempt to fix `UNUserNotificationCenterDelegateProxy` --- ...UNUserNotificationCenterDelegateProxy.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 {