Is there any known problem issue with:
application:didReceiveLocalNotification delegate
on iOS 8?
My application creates local notifications using UILocalNotification
. When application is in background I get notifications, and when I click on the notification banner, it moves to my app. But this method:
-(void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
is never called on iOS 8(Xcode 5.1.1), but works well on iOS 7 or earlier.
P.S. I've also tested project from this site: http://www.appcoda.com/ios-programming-local-notification-tutorial/ and it doesn't work on iOS 8.
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:
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.
Use this for iOS8
I meet the same problem...
You must change to use the following code:
to instead of the original:
I have noticed the same on iOS8Beta5. Same code works fine on iOS8Beta4.
Edit: If as the answer suggests, we need to handle it differently - then why did they drop support between two beta builds. It would make sense if iOS8Beta1 build behaved this way. This is why I feel its a bug.