Interface > healthstack.backend.integration > BackendFacade

BackendFacade

[androidJvm]
interface BackendFacade : HealthDataSyncClient, UserRegistrationClient, TaskClient

Facade that collects the interface required for integrating with the backend that stores health data. It provides a simple integrated interface.

Functions

Name Summary
getTasks

[androidJvm]
abstract suspend fun getTasks(idToken: String, lastSyncTime: LocalDateTime, endTime: LocalDateTime = LocalDateTime.now(Clock.systemUTC())): List<TaskSpec>
Retrieves the task that has been published since the lastSyncTime the task was retrieved.

registerUser

[androidJvm]
abstract suspend fun registerUser(idToken: String, user: User)
Used to register user's information who joined through the app to the backend.

sync

[androidJvm]
abstract suspend fun sync(idToken: String, healthData: HealthData)
Used to transmit the user's health data to the backend. Backend can distinguish users through id token.

updateUser

[androidJvm]
abstract suspend fun updateUser(idToken: String, userId: String, userProfile: UserProfile)
Used to update user's profile who joined through the app to the backend.

uploadTaskResult

[androidJvm]
abstract suspend fun uploadTaskResult(idToken: String, result: TaskResult)
Uploads the user's task execution result to Backend.

uploadTaskResultAsFile

[androidJvm]
abstract suspend fun uploadTaskResultAsFile(idToken: String, sourcePath: String, targetPath: String)
Uploads the user's task execution result as a file to Backend.