Apple Push Notification API

The Apple Push Notification API allows applications to provide various types of push notifications to devices, such as sounds (audible alerts), alerts (displaying an alert on the screen), and badges (displaying an image or number on the application icon). Push notifications require network connectivity.

The client library libclientrt wraps the Apple Push Notification API in the file SUPPushNotification.h.

In addition to using the Apple Push Notification APIs in a client application, you must configure the push configuration on the server. This is performed under Server Configuration > Messaging > Apple Push Configuration in Sybase Control Center. You must configure the device application name (for push), the device certificate (for push), the Apple gateway, and the gateway port.

The following API methods of the SUPPushNotification interface abstract the Unwired Server, resolve the push-related settings, and register with an Apple Push server, if required.

After a device successfully registers for push notifications through Apple Push Notification Service, iOS calls the didRegisterForRemoteNotificationWithDeviceToken method in the client application. iOS passes the registered device token to this function. Call the deviceTokenForPush and setupForPush methods inside the didRegisterForRemoteNotificationWithDeviceToken method, or after the method. For example, you can store the device token and application parameters in variables and use them later to call deviceTokenForPush and setupForPush.

+(void)setupForPush:(UIApplication*)application
+(void)deviceTokenForPush:(UIApplication*)application deviceToken:(NSData
*)devToken

If for any reason the registration with Apple Push Notification Service fails, iOS calls didFailToRegisterForRemoteNotificationsWithError in the client application. Call the following API inside didFailToRegisterForRemoteNotificationsWithError:

+(void)pushRegistrationFailed:(UIApplication*)application errorInfo: (NSError *)err

When iOS receives a notification from Apple Push Notification Service for an application, it calls didReceiveRemoteNotification in the client application. Call the following API inside didReceiveRemoteNotification:

+(void)pushNotification:(UIApplication*)application
notifyData:(NSDictionary *)userInfo