Setting Up Callbacks

Update your application to use callbacks available in SDK version 2.1 ESD #3 or later.

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, 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

    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. If the application uses onImport to generate a notification on instance creation and modification, you must change to use the ChangeLog facility in RBS. By default, ChangeLog is disabled and you can enable it using the generated database class. Once enabled, the server creates a change log record to identify each updated and deleted instance. Due to a limitation of RBS, the change log record only contains two operation types: update and delete. An update is actually an upsert (update/insert). Generating change logs can be expensive if you are downloading a large amount of data. For that reason, it is recommended that you disable the change log facility for initial or large delta synchronization. See Generating Change Logs.

  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;