From f20a74e02ef0096830367810db8e75b439dea7af Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 2 Jan 2018 14:15:50 +0100 Subject: [PATCH] Push notifications: More logs to track duplicated notifications --- Riot/AppDelegate.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 74bfd1f96..eee70c92e 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -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; }