When your iOS application uses the Apple Push Notification service, the device remains connected to the APNs server using an open TCP/IP connection. To send notifications to your application running on iOS devices, you need to write a provider application that communicates with that server. Your provider application will send messages to the APNs server, which in turn relays the message to the various devices running your application by pushing the message to these devices through the TCP/IP connection.

image NOTE Chapter 21 discusses the multi-tasking feature of iOS 5. While you have the capability to run your application in the background, the types of applications that are allowed to do so are limited. Also, applications running in the background are not allowed to have any network connectivity. While the steps for using the APNs are straightforward, you need to be aware of several details in order to enable messages to be pushed successfully to the devices. In this section, you learn how to create an iOS application that uses the APNs. The following sections take you through the steps for APNs programming in more detail.

Generating a Certificate Request

The first step to using the APNs is to generate a certificate request file so that you can request two development certificates — one for code-signing your application (so that it can be deployed ...

Get Beginning iOS 5 Application Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.