ProgramEntitlement

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

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")
}
}

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")
}
}

Constructors

Link copied to clipboard
constructor(name: String? = null, activated: Boolean = false, programData: ProgramData? = null)

Properties

Link copied to clipboard
Link copied to clipboard
var name: String?
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String