Registering for Remote Notifications

To enable the ShoutOut app to receive push notifications, the app needs to register with the APNs to receive push notifications. The app can be customized to register for push notifications at any point that makes sense, when the user has a good idea what value push notifications will provide from the app. For this example, however, the sample app will register with the APNs right away in the app delegate, the applicationDidFinishLaunchingWithOptions method:

- (BOOL)application:(UIApplication *)applicationdidFinishLaunchingWithOptions:(NSDictionary *)launchOptions{    [[UIApplication sharedApplication]     registerForRemoteNotificationTypes:     (UIRemoteNotificationTypeBadge ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK 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.