Internet of things

IoT

If your app uses IoT devices, you might find it useful to attach device data (eg. fw version, bt version, battery status...)

App.kt
import com.shakebugs.shake.Shake
private fun attachStatusListener() {
val device: Device = DevicesManager.getConnectedDevice()
if (device != null) {
device.setStatusListener(object: StatusListener() {
@override
fun onStatusChanged(status: Status) {
Shake.setMetadata("batteryLevel", status.batteryLevel)
Shake.setMetadata("firmwareVersion", status.firmwareVersion)
Shake.setMetadata("bluetoothVersion", status.bluetoothVersion)
}
})
}
}