Developer Docs

Swift Package integration, delegate callbacks, and example code

SDK Capabilities

The NixDistraction SDK is a Swift Package that adds workplace phone monitoring to your iOS app.

What It Does

Beacon Detection

Automatically detects NIX beacons to mark work zone entry and exit

Session Tracking

Provides connection/disconnection events to mark work session boundaries

Activity Monitoring

Reports screen lock/unlock events during active sessions

Background Operation

Works seamlessly when your app is not actively running

Platform Requirements

  • iOS: 16.0 or later
  • Xcode: 15.0 or later
  • Swift: 5.9 or later
  • Distribution: Binary XCFramework via Swift Package Manager

Integration Pattern

Simple delegate-based API:

AppDelegate.swift
import GPTNixDistraction

let sdk = GPTNixDistraction.shared()
sdk.connectionDelegate = self
sdk.exceptionDelegate = self

func nixConnectionEvent(_ connected: Bool) {
    if connected { startWorkSession() }
    else { endWorkSession() }
}

func nixExceptionEvent(_ exception: ExceptionType) {
    switch exception {
    case .screenUnLocked: trackPhonePickup()
    case .screenLocked: handleScreenLock()
    default: break
    }
}

Delegate Callbacks Your App Controls

Session boundaries, phone activity, and work vs. distraction time

Work Session Detection

NIX connected/disconnected events tell you when a work session starts and ends. The SDK debounces connection drops automatically.

Phone Pickup Counting

Screen unlock events let you count phone pickups during the shift. Track how many times workers check their phone.

In-App vs. Distraction Time

Configurable: count only outside-app time as distraction (default), or count all unlocked time. Perfect for maintenance apps where in-app use is the job.

Session Summaries

Example WorkSessionTracker included. ~30 lines to track pickups, in-app time, distraction time—ready to upload to your backend.

Included with Evaluation License

The complete integration package includes:

  • SDK package URL and access credentials
  • Full integration guide with step-by-step instructions
  • Info.plist configuration keys and permission strings
  • Background modes setup documentation
  • Complete API reference and delegate protocols
  • NixHello sample app with full source code
  • Troubleshooting guide and debugging tools

Testing Requirements: SDK testing requires a physical iOS device and NIX beacon. The iOS Simulator cannot access Bluetooth hardware. We ship a loaner NIX beacon with your evaluation.

Ready to Integrate?

Request SDK access and receive your evaluation license

Request SDK Access