iOS5 Notification Center disables Local Notifications by default on your existing apps

If your iOS app uses UILocalNotifications, you (and your users) may be wondering why you haven't been receiving them after updating iOS 5. It seems that due to a bug (or is it undocumented feature?) in iOS 5, Local Notifications now behave a lot more like Push Notifications.

By default, if your app does not register for push notifications, it will not be in the Notification Center and thus unable to send notifications (remote or local). Of course your users can always manually go into Settings -> Notifications and hunt down your app, but not all users will realize this and - as in our case - many may think your app is 'broken' in iOS 5.

Until Apple (hopefully) releases an update to fix this, a workaround is to register your app to receive Remote/Push Notifications (even if you don't use them) so that your app is "in" the Notification Center and able to receive Local Notifications. To do this, in your App Delegate's application didFinishLaunchingWithOptions method, add the following:

  1.  
  2. // Workaround for iOS5 bug. We need to register for remote notifications,
  3. // otherwise all notifications are disabled by default in the Notification Center
  4.  
  5. [[UIApplication sharedApplication]
  6. registerForRemoteNotificationTypes:
  7. UIRemoteNotificationTypeBadge |
  8. UIRemoteNotificationTypeAlert |
  9. UIRemoteNotificationTypeSound];
  10.  

At startup, your app will now prompt the user to receive push notifications and when they accept, join the ranks of other Push Notification apps in the Notification Center.

6 Comments

  1. Sylvain | November 20th, 2011

    Hi ! Thanks for the info, I kinda struggled with that. Is it fixed in iOS 5.01 ?

  2. Pingback: About iHome+Sleep alarms and iOS 5 notifications | Point One

  3. ES | December 6th, 2011

    Do we have to also configure App ID and SSL certificate to enable APN service?

  4. Stuart Radfoth | February 14th, 2012

    WOW!! Thank you for taking the time to post this, I’ve been freaking out that essentially all my reviews have stopped since iOS5 release but the downloads are continuing. Apple really need to sort this as it breaks so many apps out there.

  5. Sindhya Peter | May 5th, 2012

    Thanks a lot for sharing….!!!

  6. Vishwa Depak | October 3rd, 2012

    Thanks for the answer , I was worried for the same.. as was not able to receive the notifications..
    Is this solved in further ios updates or it stilll continues… plss reply .

    Thanks in iAdvance

Post a Comment