Skip to content

Commit dd9f404

Browse files
Lp 10840 crash local (#314)
* LP-10840: Crash for localnotification fix * Another location where swizzingling check was missing
1 parent 3967436 commit dd9f404

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Leanplum-SDK/Classes/Features/Actions/LPActionManager.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ - (void)leanplum_userNotificationCenter:(UNUserNotificationCenter *)center
176176
SEL selector = @selector(leanplum_userNotificationCenter:didReceiveNotificationResponse:
177177
withCompletionHandler:);
178178

179-
if ([self respondsToSelector:selector]) {
179+
if (swizzledUserNotificationCenterDidReceiveNotificationResponseWithCompletionHandler &&
180+
[self respondsToSelector:selector]) {
180181
[self leanplum_userNotificationCenter:center
181-
didReceiveNotificationResponse:response
182-
withCompletionHandler:completionHandler];
182+
didReceiveNotificationResponse:response
183+
withCompletionHandler:completionHandler];
183184
}
184185

185186
[[LPActionManager sharedManager] didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
@@ -197,8 +198,8 @@ - (void)leanplum_application:(UIApplication *)application
197198
fetchCompletionHandler:nil];
198199
LP_END_TRY
199200

200-
// Call overridden method.
201-
if ([self respondsToSelector:@selector(leanplum_application:didReceiveLocalNotification:)]) {
201+
if (swizzledApplicationDidReceiveLocalNotification &&
202+
[self respondsToSelector:@selector(leanplum_application:didReceiveLocalNotification:)]) {
202203
[self performSelector:@selector(leanplum_application:didReceiveLocalNotification:)
203204
withObject:application withObject:localNotification];
204205
}

0 commit comments

Comments
 (0)