Hello, I have used the same BeaconManager to start region monitoring and telemetry discovery and it looks like that when I start the telemetry discovery region enter and exit events are not triggered anymore. If I comment out the telemetry discovery start, region events are triggered again.
I used the notification sample code app as a starting point and I added the telemetry listener code to it - salient code snippets are listed below:
public BeaconNotificationsManager(Context context) {
this.context = context;
beaconManager = new BeaconManager(context);
beaconManager.setTelemetryListener(new BeaconManager.TelemetryListener() {
@Override
public void onTelemetriesFound(List telemetries) {
for (EstimoteTelemetry tlm : telemetries) {
String message = "beaconID: " + tlm.deviceId + “, temperature: " + tlm.temperature + " °C” + ", pressure: " + tlm.pressure + ", light: " + tlm.ambientLight;
Log.i(“TELEMETRY”, message);
updateUI(message);
}
}
});
beaconManager.setMonitoringListener(new BeaconManager.BeaconMonitoringListener() {
@Override
public void onEnteredRegion(BeaconRegion region, List list) {
Log.i(“REGION”, "onEnteredRegion: " + region.getIdentifier());
String message = enterMessages.get(region.getIdentifier());
if (message != null) {
showNotification(message);
updateUI(message);
}
}
@Override
public void onExitedRegion(BeaconRegion region) {
Log.i(“REGION”, "onExitedRegion: " + region.getIdentifier());
String message = exitMessages.get(region.getIdentifier());
if (message != null) {
showNotification(message);
updateUI(message);
}
}
});
}
public void startMonitoring() {
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
for (BeaconRegion region : regionsToMonitor) {
beaconManager.startMonitoring(region);
}
beaconManager.startTelemetryDiscovery();
}
});
}
any hint?
thanks