Actually, the solution on iOS 8 is to request authorization for notifications settings to the user, otherwise the delegate method -didReceiveLocalNotification: will never be called. You can do so by adding this code to the -didFinishLaunchingWithOptions: method:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings
settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
categories:nil]];
}
This will show the user an alert view asking for permission to display notifications. If she accepts, the delegate method will be called whenever a local notification is fired.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…