

On iOS, push notifications use the cellular data network whenever possible, even if the device is currently using Wi-Fi for other network activity such as web browsing or email. Once the persistent connection to the push service succeeds, one of the previously-mentioned application delegate methods will be called. Keep in mind that network availability can change frequently. Instead of treating this as an error, your app should continue normally, disabling only that functionality that relies on push notifications. The system may not have Internet connectivity at all because it is out of range of any cell towers or Wi-Fi access points, or it may be in airplane mode. This is not necessarily an error condition. If neither delegate callback application:didRegisterForRemoteNotificationsWithDeviceToken: nor application:didFailToRegisterForRemoteNotificationsWithError: is called, that means that this connection has not yet been established. When the first push-capable app is installed, iOS or OS X attempts to establish a persistent network connection to the push service that will be shared by all push-capable apps on the system. Registering for push notifications is straightforward, but there are a few important details you need to be aware of. The provider is your server that delivers dynamic content to your application.

The application passes the device token to your provider as a non-object, binary value.
MAC GRAY SERVICE REQUEST REGISTRATION
The application implements the application:didFailToRegisterForRemoteNotificationsWithError: method of UIApplicationDelegate (iOS) or NSApplicationDelegate (OS X) to receive an error if the registration failed. The application implements the application:didRegisterForRemoteNotificationsWithDeviceToken: method of UIApplicationDelegate (iOS) or NSApplicationDelegate (OS X) to receive the unique device token generated by the push service.

The application calls the registerForRemoteNotifications: method of UIApplication (iOS) or the method registerForRemoteNotificationTypes: of NSApplication (OS X). On iOS, the application asks the user for permission to receive push notifications by calling the registerUserNotificationSettings: method of UIApplication. In order to receive push notifications, an application must first register with the Apple Push Notification service (APNs or "push service"). Back to Top Issues with Receiving Push Notifications Registering for Push Notifications
