Chapter 20. Using the Push Notification Service
In This Chapter
Using the Apple Push Notification Service |
Understanding the intricacies of the push protocol |
Sending and receiving notifications |
Implementing a push provider in Ruby |
As you know, on the iPhone, resources such as memory and CPU cycles are extremely scarce. As a result, Apple has chosen to restrict applications that can run in the background to only official applications written by Apple developers. This means that your applications are unable to run in the background. This also means that if you want to produce an application that maintains a persistent connection to a server even when your application is not running, you will be unable to do so.
Apple recognizes that this is a significant barrier for certain classes of applications. An example might be instant messaging applications, where you might send a message and then wait a period of time before receiving a response to that message. It would be inconvenient to the user to have to stay in the instant messaging application all the time in order to receive new messages.
To at least partially solve this problem, Apple has introduced the Apple Push Notification Service, or APNS.
The APNS enables application developers to send notifications to their users' iPhones or iPod touches directly from their own server-side applications. The iPhone OS displays these notifications when they are received in a way similar to the way it displays SMS messages. If an application has registered ...
Get Cocoa Touch™ for iPhone® OS 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.