Skip to main content

Sync Configs Provider

Analyzes the config file downloaded from Playground located in the assets folder of the project and provides initialization information for SyncDatabase.

Summary

Public methods

createFromConfigFile()
suspend fun createFromConfigFile(
context: Context,
authType: SupportedAuthType = SupportedAuthType.CCG,
configFileName: String = "config.yaml"
):ResultCompat<SyncConfigsProvider>

Reads the config file in the assets folder and creates a SyncConfigsProvider that provides necessary information for SyncDatabase initialization.

Parameters

context: Context

Context

authType: SupportedAuthType

The authentication type, currently only Client Credentials Grant is used and set as the default.

configFileName: String

The name of the config file in the assets folder for creating SyncConfigsProvider. The default value is config.yaml, but you can change the file name as needed and reflect it in the parameter.

Returns

ResultCompat<SyncConfigsProvider>

A wrapper class that encapsulates the result of creating a provider that provides necessary information for SyncDatabase initialization. The provider analyzes the config file downloaded from Playground located in the assets folder of the project and provides initialization information.