Skip to main content

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​

  1. Install the SDK: Android or iOS.
  2. Initialize AFCore once at app launch -- see Initialization.
  3. Sign the member in with username and password or an external identity -- see Authentication.
  4. Read the member's programs to decide which features to show -- see Programs.
  5. Turn on the features the member is entitled to:
  6. Show progress with the monthly activity calendar.

Example: sign in and gate features​

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

Learn more​