Skip to main content
Version: 2.0.1

iOS SDK Guide

The Impilo Mobile SDK enables faster and unified integration of remote patient monitoring (RPM) devices for mobile applications. Our native SDK, written in Swift, handles connecting and communicating with RPM devices while providing you with standardized interactions and data.

info

These Native iOS SDK docs are written in Swift. It is interoperable with Objective-C and bindings can be made available upon request.

Installation

Add our Mobile SDK package to your project and import it:

import ImpiloMobileSDK

SDK Initialization

Create a configuration for the SDK:

let config = ImpiloMobileSDK.Config()

Initialize an SDK instance using that configuration:

let sdk = try ImpiloMobileSDK.initialize(config: config)

Implementing the Delegate

These docs focus on using the TranstekBBZ32BB01 BPM. To receive events, you provide a delegate which should implement TranstekBBZ32BB01Delegate:

class Delegate: TranstekBBZ32BB01Delegate {
func didDiscover(device: Unpaired<TranstekBBZ32BB01>) {
}
func didPair(device: TranstekBBZ32BB01) {
}
func didReceiveReading(reading: ImpiloMobileSDK.DeviceReading<BloodPressure>) {
}
}

Discovering Devices

Call discover on the desired type of device. When a device is discovered, the didDiscover delegate method will be called:

try TranstekBBZ32BB01.discover(using: sdk, delegate: delegate)

Pairing Devices

A discovered device is a device that can be paired with. To pair with the discovered device, simply call pair on the discovered device. If the pairing succeeds, the didPair delegate method will be invoked:

func didDiscover(device: Unpaired<TranstekBBZ32BB01>) {
try device.pair()
}

To remember a device for later, you can request an identifier for said device:

device.bluetoothIdentifier()

If the device is one you've already paired with before, you can skip the pairing process:

device.skipPairing()

Getting Readings

If the paired device can receive readings without programmatically initiating them, you can call monitorForReading() which will invoke the didReceiveReading delegate method with the associated reading data when a reading is received:

func didPair(device: TranstekBBZ32BB01) {
try device.monitorForReading()
}

Complete Example

Here's a complete example of how the SDK can be used:

import ImpiloMobileSDK

let config = ImpiloMobileSDK.Config()

let sdk = try ImpiloMobileSDK.initialize(config: config)

class Delegate: TranstekBBZ32BB01Delegate {
func didDiscover(device: Unpaired<TranstekBBZ32BB01>) {
try device.pair()
}
func didPair(device: TranstekBBZ32BB01) {
try device.monitorForReading()
}
func didReceiveReading(reading: ImpiloMobileSDK.DeviceReading<BloodPressure>) {
// Access reading data via .data
let systolic = reading.data.systolicInMmHg
let diastolic = reading.data.diastolicInMmHg
}
}

let delegate = Delegate()
try TranstekBBZ32BB01.discover(using: sdk, delegate: delegate)

Reading Models

The readings the SDK provides match our Impilo API. View our API documentation to see what the readings look like.

How Data is Managed

The SDK does not store any data—it only forwards received data to you. You are responsible for handling and storing readings as needed in your application.

Working with Apple Health

With an instance of the SDK, you can request access to Apple Health (HealthKit) from the user, asking for the reading types you'd like to access.

let sdk = try! ImpiloMobileSDK.initialize(config: ImpiloMobileSDK.Config())

sdk.appleHealth.requestAccess([
// Read access
ReadingType.stepCount,
ReadingType.heartRate
], [
// Write access
])

Then you can query for readings from Apple Health:

var interval = DateComponents()
interval.day = 1

let steps: [StepCountReading] = sdk.appleHealth.steps.query(
Calendar.current.date(byAdding: .day, value: -1, to: Date()), // start date
Date(), // end date
interval,
nil // optional record limit
)

let heartRates: [HeartRateReading] = sdk.appleHealth.heartRate.query(
Calendar.current.date(byAdding: .day, value: -1, to: Date()), // start date
Date(), // end date
interval,
nil // optional record limit
)

Supported Reading Types

We currently support these reading types from Apple Health:

  • Step Count
  • Heart Rate
  • Blood Glucose
  • Blood Pressure
  • Blood Oxygen
  • Body Weight
  • Body Temperature
  • Peak Expiratory Flow

More coming soon!

Looking for More Device Integrations?

For additional device integration requests, please reach out to sales@impilo.health.