Instance Method

registerForRemoteNotifications

Register to receive remote notifications via Apple Push Notification service.

Declaration

- (void)registerForRemoteNotifications;

Discussion

Call this method to initiate the registration process with Apple Push Notification service. If registration succeeds, the app calls your app delegate object’s application:didRegisterForRemoteNotificationsWithDeviceToken: method and passes it a device token. You should pass this token along to the server you use to generate remote notifications for the device. If registration fails, the app calls its app delegate’s application:didFailToRegisterForRemoteNotificationsWithError: method instead.

If you want your app’s remote notifications to display alerts, play sounds, or perform other user-facing actions, you must request authorization to do so using the requestAuthorizationWithOptions:completionHandler: method of UNUserNotificationCenter. If you do not request and receive authorization for your app's interactions, the system delivers all remote notifications to your app silently.

See Also

Registering for Remote Notifications

- unregisterForRemoteNotifications

Unregister for all remote notifications received via Apple Push Notification service.

registeredForRemoteNotifications

A Boolean indicating whether the app is currently registered for remote notifications.