Setting Up Callbacks

Update your application to use callbacks from SDK version 2.1 ESD #3.

All callback methods are included in the SUPCallbackHandler protocol, and you must implement them in any class that directly implements the protocol without subclassing the default implementation in SUPDefaultCallbackHandler.

  1. If you have directly implemented the SUPCallbackHandler protocol, you must implement all methods. In replication-based synchronization, there are several methods in the protocol that are specific to messaging-based synchronization, and will never be called.

    If you have created your callback handler as a subclass of SUPDefaultCallbackHandler, as Sybase recommends, you can safely remove the following messaging-based synchronization callbacks, as the SUPDefaultCallbackHandler has empty implementations of all the required methods.

    • beforeImport, onImport, and onImportSuccess
    • onLoginSuccess
    • onSubscribeFailure, and onSubscribeSuccess
    • onSuspendSubscriptionFailure, and onSuspendSubscriptionSuccess
    • onResumeSubscriptionFailure, and onResumeSubscriptionSuccess
    • onUnsubscribeFailure, and onUnsubscribeSuccess
    • onMessageException
    • onTransactionCommit, and onTransactionRollback
    • onRecoverFailure, and onRecoverSuccess
    • onSubscriptionEnd

    For a complete list of callbacks you can implement in your application, see Developer Guide: iOS Object API Applications > Client Object API Usage > Callback and Listener APIs.

  2. If your application uses SUPApplicationCallback, update it to use these methods:

    Old method:

    - (void)onConnectionStatusChanged:(SUPInt)connectionStatus :(SUPInt)errorCode :(SUPNullableString)errorMessage;

    New method:

    - (void)onConnectionStatusChanged:(SUPConnectionStatusType)connectionStatus :(int32_t)errorCode :(NSString*)errorMessage;

    Old method:

    - (void)onRegistrationStatusChanged:(SUPInt)registrationStatus :(SUPInt)errorCode :(SUPNullableString)errorMessage;

    New method:

    - (void)onRegistrationStatusChanged:(SUPRegistrationStatusType)registrationStatus :(int32_t)errorCode :(NSString*)errorMessage; 

    Old method:

    - (void)onDeviceConditionChanged :(SUPInt)condition;

    New method:

    - (void)onDeviceConditionChanged :(SUPDeviceConditionType)condition;