diff --git a/iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m b/iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m index a5d33f75e..715eec1d8 100644 --- a/iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m +++ b/iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m @@ -618,6 +618,14 @@ + (void)registerAsUNNotificationCenterDelegate { if (!curNotifCenter.delegate) curNotifCenter.delegate = (id)[self sharedInstance]; + else { + /* + This handles the existing delegate that exist before the OneSignal delegate is loaded. + This line ends up calling the UNUserNotificationCenter+OneSignal.m file method setOneSignalUNDelegate. + This swizzles in the OneSignal methods into the existing non-OneSignal delegate. + */ + curNotifCenter.delegate = curNotifCenter.delegate; + } } +(UNNotificationRequest*)prepareUNNotificationRequest:(OSNotificationPayload*)payload {