TulipeMoutarde.be

About

UILocalNotification alertBody

Written on June 6 2013.

This blog post was written a long time ago and may not reflect my current opinion or might be technically out of date. Read with a grain of salt.

Once again, this post is more a reminder to self than a real blog post but I've been bitten by that one.

Always set the alertBody of a UILocalNotification. If you don't, nothing will appear when the application is on the background. The documentation mentions it but it's pretty easy to miss the remark:

Assign a string or, preferably, a localized-string key (using NSLocalizedString) as the value of the message. If the value of this property is non-nil, an alert is displayed. The default value is nil (no alert).

Creating a local notification without any content is probably not common but it can happen while developing with the I will add text later mindset.