Dear all,
1/ I have some code as follow:
Code:
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd HH:mm"];
NSDate *nd = [[NSDate date] dateByAddingTimeInterval:60];
// Push 2 notifications at the same time
UILocalNotification* alarm1 = [[UILocalNotification alloc] init];
alarm1.fireDate = nd;
...
[[UIApplication sharedApplication] scheduleLocalNotification:alarm];
UILocalNotification* alarm2 = [[UILocalNotification alloc] init];
alarm2.fireDate = nd;
...
[[UIApplication sharedApplication] scheduleLocalNotification:alarm];
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
NSLog(@"===didReceiveLocalNotification===");
}
2/ When i'm at home screen after 60 seconds, having 2 alert of notification show in sequence: alarm1, alarm2.
- And i press button view on dialog of alarm2 then my view application is show up and NSLog(@"===didReceiveLocalNotification==="); is excecuted.
- And dialog of alarm 1 is show up again and when i press button view on it then NSLog(@"===didReceiveLocalNotification==="); is
not excecuted.
3/ Why is method didReceiveLocalNotification executed 1 time when i press 2 button views of 2 alerts?