SyncCallback

interface SyncCallback

A callback used to access the results from the Live Update sync process.

Example usage (kotlin):

LiveUpdateManager.sync(context, "appId", callback = object : SyncCallback {
override fun onAppComplete(syncResult: SyncResult) {
Log.d("LiveUpdate","CALLBACK: Sync success for app ${syncResult.liveUpdate.appId}!")
}

override fun onAppComplete(failResult: FailResult) {
Log.e("LiveUpdate","CALLBACK: Sync failed at step ${failResult.failStep.name} for app ${failResult.liveUpdate.appId}!")
}

override fun onSyncComplete() {
Log.d("LiveUpdate","CALLBACK: Sync finished!")
}
})

Example usage (Java):

LiveUpdateManager.sync(this, "appId", new SyncCallback() {
@Override
public void onAppComplete(@NonNull SyncResult syncResult) {
Log.d("LiveUpdate","CALLBACK: Sync success for app " + syncResult.getLiveUpdate().getAppId());
}

@Override
public void onAppComplete(@NonNull FailResult failResult) {
Log.d("LiveUpdate","CALLBACK: Sync failed at step " + failResult.getFailStep().name() + " for app " + failResult.getLiveUpdate().getAppId());
}

@Override
public void onSyncComplete() {
Log.d("LiveUpdate","CALLBACK: Sync finished!");
}
});

Functions

Link copied to clipboard
abstract fun onAppComplete(failResult: FailResult)

Called when an application is finished syncing but it failed.

abstract fun onAppComplete(syncResult: SyncResult)

Called when an application is finished syncing and completed successfully.

Link copied to clipboard
abstract fun onSyncComplete()

Called when the sync process for one or more apps is finished running.