Push Synchronization Applications

Clients receive device notifications when a data change is detected for any of the MBOs in the synchronization group to which they are subscribed.

Sybase Unwired Platform uses a messaging channel to send change notifications from the server to the client device. By default, change notification is disabled. You can enable the change notification of a synchronization group: If you see that setInterval is set to 0, then change detection is disabled, and notifications will not be delivered. Enable change detection and notification delivery by setting an appropriate value. For recommendations, see Configuring Synchronization Groups in Sybase Control Center for Sybase Unwired Platform.

id<SUPSynchronizationGroup> sg = [SUP101SUP101DB getSynchronizationGroup:@"TCNEnabled"];
  if ([sg enableSIS]) {
      [sg setEnableSIS:YES];
      [sg setInterval:2];
      [sg save];
      [SUP101SUP101DB synchronize:@"PushEnabled"];
}
When the server detects changes in an MBO affecting a client device, and the synchronization group of the MBO has change detection enabled, the server will send a notification to client device through messaging channel. By default, a background synchronization downloads the changes for that synchronization group. The application can implement the onSynchronize callback method to monitor this condition, and either allow or disallow background synchronization.
- (SUPSynchronizationActionType)onSynchronize:(SUPObjectList *)syncGroupList withContext:(SUPSynchronizationContext *)context
{
    
  switch ([context status]) { 
    case SUPSynchronizationStatus_STARTING_ON_NOTIFICATION:
            
      if(allowBackGroundSync)
      {
        return SUPSynchronizationAction_CONTINUE;
      }
      else
      {
        return SUPSynchronizationAction_CANCEL;
      }
            
      break; 
            
    default:
        return SUPSynchronizationAction_CONTINUE; // return continue for all other cases
      break;
  }
    
}