The new notifications center is one of the biggest changes to iOS 5, and also

among the best. Previously, if you missed or dismissed an alert, that’s it, it
was gone. Now you can place a finger at the information bar at the top of the
screen and pull down to reveal a whole collection of messages, e-mail,
reminders, calendar events, and other notifications you may have missed.

Comparisons with the pull-down menu in Android’s
operating system have been plentiful, and I’ll get to them later on. But yes,
the surface similarities are apparent.

A second major change is this: you can now choose between the traditional
pop-up that takes over your screen until you handle it, and a newer style that
materializes as an unobtrusive banner at the top of your screen. You can either
address the banner directly (which opens the corresponding app), or ignore it
and it’ll disappear.

In the Settings menu, a new Notifications entry
lets you choose which style you want for each item–the banner, the pop-up
(“alert”), or nothing at all. If you opt for “none,” you can
still see the item in the notifications pull-down, but you won’t be pestered
with a barrage of banners or pop-ups from more active apps like Twitter.

You’llalso see a list of apps that are eligible for, but not currently in, the
notifications center. While you can always drag and drop between the two lists,
it’s easier and much, much faster to just click into each entry and slide the
toggle to the “on” or “off” position. Bam; done.

Apparently, the app has to register itself with the Notification Center to be listed there; and then enabled by the user.

When I moved to XCode 4.2, my app did not show up in the notification center and I freaked out! Looking on the web a bit, I found the answer. I have this code in the app’s AppDelegate and all is fine now:

// Register the app for the Push- and
Local-Notifications on iOS5 – else the users will not get the
Local-Notifications

·ocal notifications are scheduled by an application
and delivered by iOS on the same device. Local notifications are available in iOS only.

·Push notifications, also known as remote
notifications, are sent by an application’s remote server (its provider) to
Apple Push Notification service, which pushes the notification to devices on
which the application is installed. Push notifications are available in both iOS and, beginning with Mac OS X v10.7 (Lion), Mac OS X.

Apple Push Notification service (APNs).

Almost immediately, your device—or more
precisely, the operating system on your device—receives the notification over
the Wi-Fi or cellular connection from APNs. Because your chess application is
not currently running, iOS displays an alert similar to Figure
1-1. The message consists of the application name, a
short message, and (in this case) two buttons: Close and View. The button on
the right is called theactionbutton and
its default title is “View”. An application can customize the title of the
action button and can internationalize the button title and the message so that
they are in the user’s preferred language.

Figure

1-1 A notification alert

If you tap
the View button, the chess application launches, connects with its provider,
downloads the new data, and adjusts the chessboard user interface to show your
friend’s move. (Pressing Close dismisses the alert.)

Let’s consider a type of application with another
requirement. This application manages a to-do list, and each item in the list
has a date and time when the item must be completed. The user can request the
application to notify it at a specific interval before this due date expires.
To effect this, the application schedules a local notification for that date
and time. Instead of specifying an alert message, this time the application
chooses to specify a badge number (1). At the appointed time, iOS displays a
badge number in the upper-right corner of the icon of the application, such as
illustrated in Figure 1-2.

For both
local and push notifications, the badge number is specific to an application
and can indicate any number of things, such as the number of impending calendar
events or the number of data items to download or the number of unread (but
already downloaded) email messages. The user sees the badge and taps the
application icon—or, in Mac OS X, clicks the icon in the dock—to launch the
application, which then displays the to-do item or whatever else is of interest
to the user.

Figure
1-2 An application icon with a badge number (iOS)

In iOS, an
application can specify a sound file along with an alert message or badge
number. The sound file should contain a short, distinctive sound. At the same
moment iOS displays the alert or badges the icon, it plays the sound to alert
the user to the incoming notification.

Notification alert message can have one button
instead of two. In the latter case, the action button is suppressed, as
illustrated in Figure 1-3. The user can only
dismiss these kinds of alerts.

Apparently, the app has to register itself with

the Notification Center to be listed there; and then enabled by the user.

When I moved to XCode 4.2, my app did not show up
in the notification center and I freaked out! Looking on the web a bit, I found
the answer.

I have this code in the app’s AppDelegate and all
is fine now:

// Register the app for the Push- and
Local-Notifications on iOS5 – else the users will not get the
Local-Notifications

Apple Push
Notification service continually monitors providers for irregular behavior,
looking for sudden spikes of activity, rapid connect-disconnect cycles, and
similar activity. Apple seeks to notify providers when it detects this
behavior, and if the behavior continues, it may put the provider’s certificate
on a revocation list and refuse further connections. Any continued irregular or
problematic behavior may result in the termination of a provider’s access to
APNs.