Zync

object Zync : SynchronizedObject

Main entry point for the Zync SDK with integrated OfflineEngine support. This class provides access to offline-first functionality for the Zuper app.

OfflineEngine Integration: This SDK integrates the existing zuper-mobile-shared OfflineEngine to provide a unified initialization and session management experience during the phased migration to Zync. All OfflineEngine functionality remains unchanged.

Use this class for initialization and session management; access features via the managers below. For specific functionality, use the appropriate manager classes:

Properties

Link copied to clipboard

Get the asset manager for handling asset operations.

Link copied to clipboard

Get the attachment manager for handling attachment operations.

Link copied to clipboard

Get the company manager for handling company operations.

Link copied to clipboard

Get the contract manager for handling contract operations.

Link copied to clipboard

Get the customer manager for handling customer operations.

Link copied to clipboard

Get the data manager for monitoring and controlling data operations.

Link copied to clipboard

Check if offline mode is currently enabled. This is a quick synchronous check using cached state.

Link copied to clipboard

Get the job manager for handling job operations.

Link copied to clipboard

Get the notes manager for handling note operations.

Link copied to clipboard
val offlineEngine: OfflineEngine

Get the OfflineEngine instance for legacy offline functionality.

Link copied to clipboard

Get the organization manager for handling organization operations.

Link copied to clipboard

Get the product manager for handling product operations.

Link copied to clipboard

Get the property manager for handling property operations.

Link copied to clipboard

Get the service task manager for handling service task operations.

Link copied to clipboard

Get the settings manager for handling user settings and preferences.

Link copied to clipboard

Get the tags manager for handling tag operations.

Link copied to clipboard

Get the user manager for handling user operations.

Functions

Link copied to clipboard
fun addIgnoredUris(ignoredUris: List<String>)
Link copied to clipboard

Get the singleton instance of Zync. Will throw an exception if initialize() has not been called first.

Link copied to clipboard

Check if there is a valid user session.

Link copied to clipboard
fun initialize(enableLogging: Boolean, fileSystem: OfflineEngineFileSystem, internetConnectivityValidator: InternetConnectivityValidator, appInfoProvider: AppInfoProvider, enableRemoteLogging: Boolean, offlineEngineConfig: OfflineEngineConfig = OfflineEngineConfig(), httpClientConfig: HttpClientConfiguration = DefaultHttpClientConfiguration(), logWriterProvider: LogWriterProvider = DefaultLogWriterProvider()): Zync

Initialize the Zync SDK with OfflineEngine integration. This must be called before using any SDK functionality.

Link copied to clipboard
fun logout()

Logout the current user and purge all local data.

Link copied to clipboard

Handle session expiry scenarios. This should be called when the session becomes invalid (e.g., token expiry). This method preserves local data to avoid losing unsaved changes.

Link copied to clipboard
fun setSession(accessToken: String, userUid: String, companyUid: String, region: String, baseUrl: String, offlineEngineLogLevel: OfflineEngineLogLevel)

Set the user session information. This information will be used for all subsequent API calls.

Link copied to clipboard
fun updateRemoteConfig(configJson: String)

Update remote configuration for Zync SDK.