Program Feature
ProgramFeature — represents a feature inside a ProgramEntitlement.
Features are specific capabilities within a program. For example, the GymVisits program may include:
Check-In
Automatic Visits
Self-Report
Facilities
Properties
name Feature name (e.g.,
"Automatic Visits","Facilities").activated Whether the feature is enabled for the signed-in member.
Notes
Retrieved via com.advantahealth.api.programs.Programs.getAvailableFeatures.
Features control granularity inside a program (e.g., GymVisits → Self-Report).
Android (Kotlin) — checking Self-Report
lifecycleScope.launch {
val features = AFCore.programs().getAvailableFeature()
val selfReport = features.find { it?.name == "Self-Report" }
if (selfReport?.activated == true) {
AFCore.selfReport().submit(
facilityId = 42,
timestampInSeconds = Clock.System.now().epochSeconds,
timeSpentInSeconds = 3600,
atFacility = true
)
} else {
showError("Self-Report feature not enabled")
}
}Content copied to clipboard
iOS (Swift) — checking Self-Report
Task {
let features = try await AFCore.shared.programs().getAvailableFeature()
if features.contains(where: { $0?.name == "Self-Report" && $0?.activated == true }) {
try await AFCore.shared.selfReport().submit(
facilityId: 42,
timestampInSeconds: Int64(Date().timeIntervalSince1970),
timeSpentInSeconds: 3600,
atFacility: true
)
} else {
print("Self-Report feature not enabled")
}
}Content copied to clipboard