Skip to content

Commit 08d8a0f

Browse files
dejan2ke7mac
andauthored
prevent tracking open for remote notifications when app is in foreground and there is no users action (#384)
Co-authored-by: Mayank Sanganeria <[email protected]>
1 parent 8555404 commit 08d8a0f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Leanplum-SDK/Classes/Notifications/Push/LPPushNotificationsHandler.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,14 @@ - (void)maybePerformNotificationActions:(NSDictionary *)userInfo
218218
if ([self isDuplicateNotification:userInfo]) {
219219
return;
220220
}
221-
221+
222+
if (UIApplication.sharedApplication.applicationState == UIApplicationStateActive) {
223+
if (userInfo[LP_KEY_PUSH_NO_ACTION] ||
224+
userInfo[LP_KEY_PUSH_NO_ACTION_MUTE]) {
225+
return;
226+
}
227+
}
228+
222229
LPLog(LPInfo, @"Handling push notification");
223230
NSString *messageId = [[LPNotificationsManager shared] messageIdFromUserInfo:userInfo];
224231
NSString *actionName;

0 commit comments

Comments
 (0)