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

CREATING THE IOS APPLICATION

Finally, you can write your iOS application to receive push notifications. The following Try It Out shows how you can programmatically receive notifications received from the APNs server.

TRY IT OUT: Creating an iOS Application

image

  1. In Xcode, create a new Single View Application (iPhone) project and name it ApplePushNotification. You will also use the project name as the Class Prefix and ensure that you have the Use Automatic Reference Counting option unchecked.
  2. Drag and drop a WAV file (shown as beep.wav in this example) onto the Supporting Files folder in Xcode (see Figure 19-17).

    image

    FIGURE 19-17

  3. Double-click on the project name in Xcode and select the ApplePushNotification target. Select the Info tab, and set the Bundle Identifier to net.learn2develop.BegiOS5PushAppID (see Figure 19-18). This is the Bundle Identifier you set when you created the App ID earlier. As mentioned earlier, you should use your own unique Bundle Identifier.

    image

    FIGURE 19-18

  4. Click the Build Settings tab and type Code Signing in the search box. In the Any iOS Device item (under Debug), select the profile that matches the Bundle Identifier, as shown in Figure 19-19.

    FIGURE 19-19

  5. In the ...

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