Installation
Add the Neccessory iOS SDK to your app with Swift Package Manager and set up camera access.
The Neccessory iOS SDK measures vital signs from the front camera. Your app captures the frames, and the SDK computes the metrics on the device.
Get the package
The SDK is available on request. Email support@neccessory.com, and we send you the package for your account: a Swift package URL or an archive.
You also need a key ID for your account. See API keys.
Requirements
| Requirement | Minimum |
|---|---|
| iOS | 16.0 |
| Xcode | A current release. We state the minimum version with the package |
| Device | A physical device with a front camera |
The SDK builds and links for the simulator, but the simulator has no camera. Run measurements on a device.
Add the package
- In Xcode, choose File → Add Package Dependencies…
- Paste the package URL we sent you. If you received an archive, unpack it, click Add Local… and select the unpacked folder.
- Add the
NeccessorySDKlibrary to your app target.
If you declare dependencies in Package.swift, add the package and the NeccessorySDK
product. Replace the placeholders with the URL and version we send you:
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "YourApp",
platforms: [.iOS(.v16)],
dependencies: [
.package(url: "<package URL we provide>", from: "<version>")
],
targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "NeccessorySDK", package: "NeccessorySDK")
]
)
]
)For an unpacked archive, replace the .package(url:from:) line with
.package(path: "../NeccessorySDK"), pointing at the unpacked folder.
Camera permission
The SDK does not open the camera. Your app captures frames with AVFoundation and passes
them to the SDK, so your app declares camera use in Info.plist:
<key>NSCameraUsageDescription</key>
<string>The camera measures your heart rate and other vital signs from your face.</string>Without this key, iOS terminates the app when it accesses the camera. Ask for permission
with AVCaptureDevice.requestAccess(for: .video) before you start capture — the
Quickstart shows where.
Network and privacy
The SDK computes every metric on the device. It downloads nothing at runtime and works without a network connection. Camera frames never leave the device.
The only network call is submit(), and only if you call it. The recommended path is to
send the result to your own backend and store it from there.
Import
import NeccessorySDK