Install on iOS
AFCore is distributed as an XCFramework wrapped in a Swift Package, hosted on GitHub at AdvantaHealth/AFCore.
For step-by-step Xcode walkthroughs, capability setup, and App Store Connect notes, see the legacy iOS Setup page.
Quick add (Swift Package Manager)
- Xcode → File → Add Package Dependencies…
- Repository URL:
https://github.com/AdvantaHealth/AFCore.git - Version: Up to Next Major from the latest release
- Add AFCore to your app target. Optionally add AFCoreUI for the SwiftUI component library.
Minimum project setup
import AFCore
do {
let config = AFCoreConfig.Builder()
.baseUrl(value: "https://api.example.com")
.clientId(value: "…from AIDE…")
.clientSecret(value: "…from AIDE…")
.enableLogging(value: true)
.logLevel(value: AFLogLevel.verbose)
.build()
try AFCore.shared.initialize(config: config)
} catch {
print("AFCore initialization failed: \(error)")
}
See Initialization for the full lifecycle, and Session Management for sign-in flow.
What ships in the framework
AFCore— main entry point + all feature accessorsAFCoreUI(optional product) — themed SwiftUI components, see UI ComponentsPrivacyInfo.xcprivacy— Apple privacy manifest, auto-embedded
Background tasks (offline outbox)
If your app posts visits, self-reports, or barcode submissions, register the AFCore background task handler so the Event Outbox can flush queued events when the device is offline at capture time.
- Add
com.advantahealth.afcore.outbox-flushto yourInfo.plistunderBGTaskSchedulerPermittedIdentifiers. - Enable Background fetch in Signing & Capabilities → Background Modes.
- Call
AFBackgroundTasks.shared.registerHandler()beforeapplication(_:didFinishLaunchingWithOptions:)returns.
Android handles this automatically via WorkManager — no setup required.