O'Reilly logo

Beginning iOS 5 Application Development by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

LOCAL NOTIFICATION

In Chapter 19, you learn about the Apple Push Notification service (APNs), which enables an application to receive notifications even if it is no longer running on the device. Using the APNs, the provider of an application can continuously keep the user updated, by pushing messages directly to the user through Apple's Push server.

In addition to the APNs, the iPhone also supports another notification framework, local notifications. While the notifications for APNs are sent by the application provider, local notifications are scheduled by the application and delivered by the iOS on the same device. For example, suppose you are writing a to-do list application. At a specific time, your application will display notifications to the user, reminding them of some future tasks. This scenario is a perfect example of the use of local notifications. Another good use of a local notification is that of a location application. The user may be running your application in the background, and when the application detects that the user is in the vicinity of a certain location, it can display a notification.

The following example illustrates the building blocks that you need to have in place in order to create an application that uses local notifications.

TRY IT OUT: Creating Local Notifications

image

  1. Using Xcode, create a new Single View Application (iPhone) project and name it

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required