It appears the list of beacons returned by onEnteredRegion is empty when using secure UUID. It works when the beacon is not secured. As far as I can see I am logged in to the Estimote SDK, since information can be fetched.
Code below. Please note I am using a Nexus 5 running Marshmallow for testing.
As a follow up question: Is it possible to randomize only Major/Minor and keep the UUID non-randomized? It appears suboptimal to scan for all beacons with Region(“SecureRegion”, null, null, null), only because the UUID keeps on changing.
Thank you for your replies in advance
EstimoteSDK.initialize(getContext(), getString(R.string.estimote_app_id), getString(R.string.estimote_token));
EstimoteSDK.enableDebugLogging(true);
//this is just to check if estimote initialized correctly
MacAddress macAddress = MacAddress.fromString("XXXXXXX");
EstimoteCloud.getInstance().fetchBeaconDetails(macAddress, new CloudCallback<BeaconInfo>() {
@Override
public void success(BeaconInfo beaconInfo) {
Log.d(TAG, beaconInfo.toString());
//this works and yields all relevant information
}
@Override
public void failure(EstimoteServerException e) {
Log.d(TAG, e.toString());
}
} );
beaconManager = new BeaconManager(getApplicationContext());
beaconManager.setMonitoringListener(new BeaconManager.MonitoringListener() {
@Override
public void onEnteredRegion(Region region, List<Beacon> list) {
ShowNotification("Entered region");
if (list.isEmpty()) {
Log.d(TAG, "List of beacons is EMPTY.... WHY!?");
return;
}
}
@Override
public void onExitedRegion(Region region) {
ShowNotification("Exited region");
new AsyncCheckOut().execute();
}
});
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
Log.d(TAG, "Starting monitoring");
beaconManager.startMonitoring(new Region("SecureRegion", null, null, null));
}
});