Program Entitlement
class ProgramEntitlement(var name: String? = null, var activated: Boolean = false, var programData: ProgramData? = null)
ProgramEntitlement — represents a high-level program/module available to the member.
A program is a main feature area (e.g., SmartWalking, GymVisits, Fit@Home). A member must have the program activated in order to use its corresponding SDK modules.
Properties
name Program name (e.g.,
"SmartWalking","GymVisits").activated Whether the program is enabled for the logged-in member.
Notes
Retrieved via com.advantahealth.api.programs.Programs.getAvailablePrograms.
Program activation is controlled by tenant/admin configuration.
Android (Kotlin) — checking SmartWalking
lifecycleScope.launch {
val programs = AFCore.programs().getAvailablePrograms()
val smartWalking = programs.find { it?.name == "SmartWalking" }
if (smartWalking?.activated == true) {
AFCore.smartwalking().syncSteps()
} else {
showError("SmartWalking program not enabled")
}
}Content copied to clipboard
iOS (Swift) — checking SmartWalking
Task {
let programs = try await AFCore.shared.programs().getAvailablePrograms()
if programs.contains(where: { $0?.name == "SmartWalking" && $0?.activated == true }) {
try await AFCore.shared.smartwalking().syncSteps()
} else {
print("SmartWalking program not enabled")
}
}Content copied to clipboard