Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Only one syncDataFinished handler can be added.

Register for Notifications

registerSync

Once either or both of the sync progress and completion handlers have been registered with the Pulsar bridge, the 'registerSync' request can be used to enable these handlers to respond to any sync events that occur, not just API initiated ones. This request takes a single boolean parameter to determine whether we are registering ("true") or de-registering ("false") for sync notifications.

Info

NOTE: This is new functionality for Pulsar versions 2.1.6 (Android and UWP) and 3.1.0 (iOS) – in older releases the 'syncData' API request will register and de-register for sync notifications automatically, restricting this behavior to API-initiated syncs.

Code Block
languagejs
var request = { 
	"type" : "registerSync",
	"data" : "TRUE" // required- this is the value to set "FALSE" for de-registering, "TRUE" for registering
};

bridge.sendRequest(request, function (results) {
	if (results.type === "registersyncResponse")	{
		var registeredForSync = results.data.registered; //string value "TRUE" or "FALSE"
		// do something with the information
    } else if (results.type == 'error') {
	    errStr = results.data;
	    alert('A problem occurred:\n' + errStr);
    }
});  

interruptsync

The interruptsync request will attempt to stop the currently running sync, if any.

...