Skip to content

Commit 23ab415

Browse files
authored
Swizzling Fix (#107)
• Fixes an issue where a swizzled implementation of the UNUserNotificationCenter.setDelegate() method was not calling back to the original implementation if it had previously been set.
1 parent d9617f8 commit 23ab415

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

OneSignalExample/Assets/OneSignal/Platforms/iOS/OneSignalUnityRuntime.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ + (void)load {
116116

117117
static Class delegateClass = nil;
118118

119-
- (void) setOneSignalUnityDelegate:(id<UIApplicationDelegate>)delegate {
120-
if(delegateClass != nil)
121-
return;
119+
- (void) setOneSignalUnityDelegate:(id<UIApplicationDelegate>)delegate {
120+
if(delegateClass) {
121+
[self setOneSignalUnityDelegate:delegate];
122+
return;
123+
}
122124

123125
delegateClass = getClassWithProtocolInHierarchy([delegate class], @protocol(UIApplicationDelegate));
124126

0 commit comments

Comments
 (0)