Communicate natively with external Bluetooth Low Energy (BLE) peripheral hardware, medical devices, and IoT sensors.
Communicate natively with external Bluetooth Low Energy (BLE) peripherals and IoT hardware. Nativine embeds native CoreBluetooth (iOS) and Android Bluetooth Central Manager SDKs, allowing web applications to scan, connect, read, and write GATT characteristics.
Connecting web software to physical hardware devices requires low-level Bluetooth access. Nativine's native Bluetooth BLE plugin provides direct GATT service communication for IoT, fitness, and medical devices:
To scan for BLE hardware peripherals or write data to a GATT characteristic in JavaScript, call nativine.bluetooth.startScan():
// Scan for BLE devices
nativine.bluetooth.startScan({
serviceUUIDs: ['180D'], // Heart Rate Service UUID
callback: 'onDeviceFound'
});
// Write data byte array to GATT characteristic
nativine.bluetooth.writeCharacteristic({
deviceId: 'device_mac_or_uuid',
serviceUUID: '180D',
characteristicUUID: '2A37',
dataBase64: 'AQIA',
callback: 'onWriteComplete'
});
| Parameter | Type | Description |
|---|---|---|
serviceUUIDs | array | Required. Array of 16-bit or 128-bit GATT Service UUID strings. |
dataBase64 | string | Required. Base64-encoded raw byte string to write to characteristic. |
Yes. iOS and Android mandate presenting a system Bluetooth permission prompt before scanning or connecting to peripherals.
Yes. Subscribing to GATT characteristic notifications streams real-time sensor readings directly to your JavaScript callbacks.