SUPApplicationCallback API

This callback protocol is invoked by events of interest to a mobile application.

You must register an SUPApplicationCallback implementation to your SUPApplication instance to receive these callbacks.
Note: These callbacks are not triggered by changes or errors in MobiLink™ synchronization, which uses a different communication path than the one used for registration.
Callbacks in the SUPApplicationCallback Interface
Callback Description
- (void)onApplicationSettingsChanged :(SUPStringList*)names Invoked when one or more application settings have been changed by the server administration.
- (void)onConnectionStatusChanged :(SUPInt)connectionStatus :(SUPInt)errorCode :(SUPNullableString)errorMessage Invoked when the connection status changes. The possible connection status values are defined in the ConnectionStatus class.
Note: Some of the connection status codes are not returned on certain client platforms due to platform operating system limitations.
- (void)onDeviceConditionChanged :(SUPInt)deviceCondition Invoked when a condition is detected on the mobile device that may be of interest to the application or the application user. The possible device condition values are defined in the SUPDeviceCondition class.
- (void)onRegistrationStatusChanged :(SUPInt)registrationStatus :(SUPInt)errorCode :(SUPNullableString)errorMessage Invoked when the registration status changes. The possible registration status values are defined in the SUPRegistrationStatus class.
- (void)onHttpCommunicationError :(int32_t)errorCode :(NSString*) errorMessage :(SUPStringProperties*)responseHeaders; Invoked when an HTTP communication server/MobiLink rejects HTTP/MobiLink communication with an error code.
  • errorCode – Error code returned by the HTTP server or MobiLink. For example: code 401 for authentication failure, code 403 for authorization failure, and code 63 for MobiLink synchronization communication error.
  • errorMessage – Error message returned by the HTTP server or MobiLink.
  • responseHeaders – Response headers returned by the HTTP server or MobiLink.
- (void)onCustomizationBundleDownloadComplete : (NSString*) customizationBundleID: (int32_t) errorCode : (NSString*) errorMessage; Invoked when the download of a resource bundle is complete.
  • errorCode – If download succeeds, returns 0. If download fails, returns an error code.
  • errorMessage – If download succeeds, returns "". If download fails, returns an error message.
    • RESOURCE_BUNDLE_NOTFOUND = 14881
    • DOWNLOAD_RESOURCE_BUNDLE_STREAM_IS_NULL = 14882
    • DOWNLOAD_RESOURCE_BUNDLE_FAILURE = 14883
  • customizationBundleID – The name of the resource bundle. If null, the default application resource bundle is downloaded.
(int)onPushNotification :(NSDictionary*)notification Invoked if a push notification arrives. You can add logic here to handle the notification. This callback is not called when a notification arrives when the application is not online.
  • returns – an integer to indicate if the notification has been handled. The return value is for future use. You are recommended to return SUP_NOTIFICATION_CONTINUE.
    • 0: SUP_NOTIFICATION_CONTINUE if the notification was not handled by the callback method.
    • 1: SUP_NOTIFICATION_CANCEL if the notification has already been handled by the callback method.
When iOS receives a notification from the 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
If
+(void)pushNotification:(UIApplication*)application notifyData:(NSDictionary *)userInfo
is added inside of didReceiveRemoteNotification, then only the callback method
(int)onPushNotification :(NSDictionary*)notification
is triggered.