Push notifications: More logs to track duplicated notifications

This commit is contained in:
manuroe
2018-01-02 14:15:50 +01:00
parent 356516f120
commit f20a74e02e
+6
View File
@@ -1644,9 +1644,13 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
*/
- (UILocalNotification*)displayedLocalNotificationForEvent:(NSString*)eventId andUser:(NSString*)userId type:(NSString*)type
{
NSLog(@"[AppDelegate] displayedLocalNotificationForEvent: %@ andUser: %@. Current scheduledLocalNotifications: %@", eventId, userId, [[UIApplication sharedApplication] scheduledLocalNotifications]);
UILocalNotification *limitedLocalNotification;
for (UILocalNotification *localNotification in [[UIApplication sharedApplication] scheduledLocalNotifications])
{
NSLog(@" - %@", localNotification.userInfo);
if ([localNotification.userInfo[@"event_id"] isEqualToString:eventId]
&& [localNotification.userInfo[@"user_id"] isEqualToString:userId]
&& (!type || [localNotification.userInfo[@"type"] isEqualToString:type]))
@@ -1656,6 +1660,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
}
}
NSLog(@"[AppDelegate] displayedLocalNotificationForEvent: found: %@", limitedLocalNotification);
return limitedLocalNotification;
}