AFCore Documentation
AFCore is the Kotlin Multiplatform SDK behind health and wellness apps built on the Advanta Health platform. One shared business-logic layer ships as native artifacts for Android, iOS and watchOS, so your app gets the same member experience and the same behavior on every platform.
The current release is 1.12.1, with fixes for 1.12.0. AFCore 1.12 adds the locations(), content() and activePerks() modules, member-safe error messages and the realm setting for Horizon apps, and has breaking changes -- see Upgrading to 1.12.
What you can do
- Sign members in with username and password, an external identity from your SSO, or tokens issued by your backend.
- Read member data: profile, programs and entitlements, monthly activity and goals.
- Credit activity automatically: gym visits through visit detection, steps through Apple Health and Health Connect, plus self-reports, barcode check-ins and Fit@Home selfies.
- Find places: favorites, nearby and map search, nominations of new locations.
- Render server-driven content: bottom navigation, home banners and the Explore menu, localized.
- Offer rewards and premium programs such as ActivePerks, Mental Fitness and MyCarePath, gated by the member's entitlements.
- Keep working offline: submissions made without a connection are delivered automatically when the device is back online.
Getting access
The SDK is gated through the AIDE Developer Portal, a separate Advanta Health product for account access, API keys, member rosters and support. Before you integrate, your team needs an AIDE account, API credentials for your organization and a configured member roster -- your Advanta Health Account Manager can set these up.
At a glance
- Android (Kotlin)
- iOS (Swift)
val config = AFCoreConfig.builder()
.baseUrl("https://api.example.com")
.build()
AFCore.initialize(config)
val result = AFCore.authentication().authenticateWithCredentials(username, password)
if (result.status) {
val programs = AFCore.programs().getAvailablePrograms()
}
let config = AFCoreConfig.Builder()
.baseUrl(value: "https://api.example.com")
.build()
try AFCore.shared.initialize(config: config)
let result = try await AFCore.shared.authentication()
.authenticateWithCredentials(username: username, password: password)
if result.status {
let programs = try await AFCore.shared.programs().getAvailablePrograms()
}
Apps whose members are on the Horizon platform also set the realm -- see Initialization.
Where to go next
| Section | Use it when |
|---|---|
| Getting Started | You want the integration steps in order |
| Installation | You are adding the SDK to an Android or iOS project |
| Upgrading to 1.12 | You are moving an app from 1.11 |
| Core Concepts | You want the lifecycle, session and error model |
| Entitlements | You are wiring up a product feature such as Gym Visits or SmartWalking |
| Sample Apps | You would rather read working code first |
| UI Components | You want themed SwiftUI / Compose building blocks |
| API Reference | You need the full Kotlin/Swift symbol surface |
Learn more
The API Reference documents every public type and method. Complete integration guides are in AIDE Docs. For help, use the AIDE Developer Portal, email support@advantahealth.com or contact your Account Manager.