Push notifications: Add fireDate to UILocalNotification in order to retrieve them afterwards.

It seems to be mandatory to make `[[UIApplication sharedApplication] scheduledLocalNotifications]` non empty
This commit is contained in:
manuroe 2018-01-02 15:03:25 +01:00
parent cf066a7e07
commit 4e91844403

View file

@ -1391,6 +1391,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
notificationBody = [notificationBody stringByReplacingOccurrencesOfString:@"%" withString:@"%%"]; notificationBody = [notificationBody stringByReplacingOccurrencesOfString:@"%" withString:@"%%"];
UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; UILocalNotification *eventNotification = [[UILocalNotification alloc] init];
eventNotification.fireDate = [NSDate date];
eventNotification.timeZone = [NSTimeZone localTimeZone];
eventNotification.alertBody = notificationBody; eventNotification.alertBody = notificationBody;
eventNotification.userInfo = @{ eventNotification.userInfo = @{
@"type": @"full", @"type": @"full",
@ -1590,6 +1592,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
} }
UILocalNotification *localNotificationForFailedSync = [[UILocalNotification alloc] init]; UILocalNotification *localNotificationForFailedSync = [[UILocalNotification alloc] init];
localNotificationForFailedSync.fireDate = [NSDate date];
localNotificationForFailedSync.timeZone = [NSTimeZone localTimeZone];
localNotificationForFailedSync.userInfo = userInfo; localNotificationForFailedSync.userInfo = userInfo;
localNotificationForFailedSync.alertBody = [self limitedNotificationBodyForEvent:eventId inMatrixSession:mxSession]; localNotificationForFailedSync.alertBody = [self limitedNotificationBodyForEvent:eventId inMatrixSession:mxSession];