Getting Started with AFCore
AFCore gives your app the data layer and service engines of the Advanta Health platform: member sign-in, activity tracking, visit detection, health-data sync and server-driven content. This page shows the order in which a typical integration comes together.
Before you start
Confirm with your Account Manager that you have:
- SDK access to the AFCore releases.
- A base URL for each environment (QA and Production), and API credentials from AIDE if your members sign in with an external identity.
- A configured organization: member enrollment (eligibility file or SSO), program goals and the entitlements your members hold, such as Gym Visits, SmartWalking, Fit@Home and Self-Report.
Integration steps
- Install the SDK: Android or iOS.
- Initialize AFCore once at app launch -- see Initialization.
- Sign the member in with username and password or an external identity -- see Authentication.
- Read the member's programs to decide which features to show -- see Programs.
- Turn on the features the member is entitled to:
- Gym Visits -- favorite locations plus automatic visit detection.
- SmartWalking -- connect Apple Health or Health Connect and sync steps automatically.
- Fit@Home and Self-Report -- selfie check-ins and manual visit logging.
- Show progress with the monthly activity calendar.
Example: sign in and gate features
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
val result = AFCore.authentication().authenticateWithCredentials(username, password)
if (!result.status) return@launch showError(result.statusMessage)
val active = AFCore.programs().getAvailablePrograms()
.filter { it.activated }
.mapNotNull { it.name }
showHome(active)
}
Task {
let result = try await AFCore.shared.authentication()
.authenticateWithCredentials(username: username, password: password)
guard result.status else { return showError(result.statusMessage) }
let active = try await AFCore.shared.programs().getAvailablePrograms()
.filter { $0.activated }
.compactMap { $0.name }
showHome(active)
}
Learn more
- API Reference for every type and method.
- Sample Apps for a working app on each platform.
- Complete integration guides are in AIDE Docs.
- Help: support@advantahealth.com or your Account Manager.