React Native
Connections
export enum Connections {
ANT = 'ANT',
BLE = 'BLE',
WEAR_OS = 'WEAR_OS',
WATCH_OS = 'WATCH_OS',
ANDROID = 'ANDROID',
ALL_DEVICES = 'ALL_DEVICES',
APPLE = 'APPLE',
}Platform availability:
BLE
Yes
Yes
APPLE
Yes
No
WATCH_OS
Yes
No
ANT
No
Yes
WEAR_OS
No
Yes
ANDROID
No
Yes
ALL_DEVICES
No
Yes
Passing an unsupported connection type for the current platform will silently fail.
DataTypes
On iOS, only 12 of these 17 values are recognized: HEART_RATE, ECG, STEPS, HRV, CALORIES, LOCATION, SPEED, DISTANCE, STEPS_CADENCE, FLOORS_CLIMBED, GYROSCOPE, ACCELERATION. The others (ACTIVITY, POWER, BIKE_CADENCE, MET, RR_INTERVAL) are silently ignored on iOS.
Types
SuccessMessage
GetUserId
Update
Data points delivered via the "Update" event emitter.
Device
Initialization
initTerra
Creates and authenticates the RT SDK instance. Makes a network call.
devId➡ Your developer ID.referenceId➡ Optional user identifier in your system.
initConnection
Authenticates the SDK user. Makes a network call. Token should be generated server-side.
getUserId
Returns the Terra user ID for the device.
disconnect
Disconnects from the specified connection type.
Device Scanning
startDeviceScan
Starts device scanning with the built-in UI widget. Android only — on iOS, this returns {success: false} with an error directing you to use the BLWidget native view instead.
startDeviceScanWithCallback
Starts device scanning and emits discovered devices via the "Device" event. Use connectDevice() to connect to a chosen device.
Listen for devices using NativeEventEmitter:
connectDevice
Connects to a specific device discovered via startDeviceScanWithCallback.
Data Streaming
startRealtime
Starts real-time data streaming. When token is provided, data is sent to Terra's websocket server. When null, data is streamed locally only.
Data updates and connection state changes are delivered via NativeEventEmitter:
stopRealtime
Stops streaming for the specified connection type.
WatchOS Integration
connectWithWatchOS
Establishes a WatchConnectivity session with the paired Apple Watch. iOS only — rejects on Android.
iOS Native View: BLWidget
On iOS, the BLE device scanner is provided as a native view component (since iOS does not support the startDeviceScan widget flow). Use requireNativeComponent:
Last updated
Was this helpful?