Run the iOS Sample
git clone https://github.com/AdvantaHealth/AFCore.git
cd AFCore
# Build the embedded XCFramework so the sample's local SPM dep resolves
./gradlew :core:assembleAFCoreXCFramework
# Open the Xcode project
open sample/ios/iosApp.xcodeproj
In Xcode:
- Select the iosApp (iOS) scheme
- Pick an iPhone simulator (iOS 17+) or a real device
- ⌘R to run
On first launch the Initialize screen will ask for:
- Base URL — your QA endpoint
- Client ID & Client Secret — from AIDE → API Keys
After Initialize, the Login screen accepts a test member credential or an external user id for signInOrCreateMember.
What's wired up
The sample organizes AFCore demos into five user-facing tabs plus a hidden Developer tab:
| Tab | Demonstrates |
|---|---|
| Home | Initialization state, session lifecycle, programs & entitlements |
| Activity | ActivityCalendarView, drill-down per day, status badges |
| Check-In | CheckInSheet with scan / map / manual flows |
| Wellness | SmartWalking sync state, Mental Fitness SpotIt feedback |
| Profile | Member profile, payments, settings, sign-out |
| Developer (hidden) | The original 28 function-by-function screens — every single API surface |
The visible tabs are built with AFCoreUI; the Developer tab uses plain SwiftUI for ground-truth testing.
XCTests
xcodebuild test \
-project sample/ios/iosApp.xcodeproj \
-scheme iosAppTests \
-destination 'platform=iOS Simulator,name=iPhone 16'
Covers SDK initialization, Keychain storage, HealthKit availability, geofence regions, boot-config persistence, and session-state observation.