Beacons stopMonitoring doesn't stop monitoring the specified region
lchinke opened this issue · comments
Hi,
i am trying to stop monitoring a beacon region but its not working. The message i receive is the following:
beacons: invoke beacons->stopMonitoring {"identifier":"b65de587b6494010af5bb6a733fc8ddd","ids":["b65de587-b649-4010-af5b-b6a733fc8ddd"],"bluetoothAddress":null}I/flutter (13139): beacons: finished without data
To solve this error, in BeaconClient.kt change stopMonitoring() method to:
fun stopMonitoring(region: RegionModel) {
region.initFrameworkValue()
sharedMonitor!!.stop(region)
beaconManager!!.stopMonitoringBeaconsInRegion(region.frameworkValue);
// val toRemove = requests.filter { it.kind == Operation.Kind.Monitoring && it.region.identifier == region.identifier }
// if (toRemove.isEmpty()) return
// toRemove.forEach { stopRequest(it) }
// requests.removeAll(toRemove)
}