Skip to main content

Install iOS

Minimum Requirements

  • Xcode: 15+
  • iOS target: 14+
  • Device features: Location, Bluetooth LE (beacons), Motion, HealthKit, Push

Add the SDK

  • Drag AFCore.xcframework into your project (Link with your app target).

Xcode Capabilities (Signing & Capabilities)

Enable only what you need:

  • Background Modes
    • Location updates (geofencing)
    • Remote notifications (push)
    • Uses Bluetooth LE accessories (beacons, if proximity enabled)
  • HealthKit (read)
  • Push Notifications

Info.plist keys (usage descriptions)

Add clear, human-readable explanations (App Review checks these):

<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location helps us confirm gym visits and show nearby facilities.</string>

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We use your location in the background to confirm attendance even when the app is closed.</string>

<key>NSHealthShareUsageDescription</key>
<string>This app reads your steps and activity from Apple Health to power your wellness rewards.</string>

<key>NSMotionUsageDescription</key>
<string>Motion access supports activity insights and rewards.</string>

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Bluetooth is used to detect nearby clubs via beacons for accurate check-ins.</string>

Initialize AFCore Call once on app launch.

import SwiftUI
import AFCore

@main
struct iOSApp: App {
init() {
do {
let config = AFCoreConfig.Builder()
.baseUrl(value: "")
.clientId(value: "")
.clientSecret(value: "")
.enableLogging(value: true)
.logLevel(value: AFLogLevel.verbose)
.build()

try AFCore.shared.initialize(config: config)
} catch {
print("Uh oh...")
}
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

App Store privacy & background review notes

  • App Privacy → declare Location (precise + background), Bluetooth, Health (read only), Identifiers (device ID for push).
  • Add a Privacy Policy link and describe how data is used (attendance verification, health rewards).
  • Provide in-app disclosure screens that precede permission prompts.
  • Avoid requesting Always immediately; upgrade from When In Use after education.
  • Test with TestFlight; App Review may ask for a demo account and steps to reproduce background geofencing.