Instance Method

registerForRemoteNotificationTypes:

Register to receive notifications of the specified types from a provider through the Apple Push Notification service.

Declaration

- (void)registerForRemoteNotificationTypes:(NSRemoteNotificationType)types;

Parameters

types

A bit mask specifying the types of notifications the app accepts. See NSRemoteNotificationType for valid bit-mask values.

Discussion

When you send this message, the device initiates the registration process with Apple Push Notification Service. If it succeeds, the app delegate receives a device token in the application:didRegisterForRemoteNotificationsWithDeviceToken: method; if registration doesn’t succeed, the delegate is informed via the application:didFailToRegisterForRemoteNotificationsWithError: method. If the app delegate receives a device token, it should connect with its provider and pass it the token.

See Also

Managing Remote Notifications

- registerForRemoteNotifications

Register for notifications sent by Apple Push Notification service (APNs).

- unregisterForRemoteNotifications

Unregister for notifications received from Apple Push Notification service.

enabledRemoteNotificationTypes

The types of push notifications that the app accepts.

registeredForRemoteNotifications

A Boolean value indicating whether the app is registered with Apple Push Notification service (APNs).

NSRemoteNotificationType

These constants determine whether apps launched by remote notifications display a badge.