This question might be answered already but we would like to have a explicit confirmation.
Currently we are using Proprietary beacons working as iBeacons in our business and we have reach the same problem most people is facing with background scanning we turn to our provider and they told us they were aware of the issue but have not been able to fix it to work on background scanning.
We found David Young blog post decide it to give a try how ever we found two blockers
We are not able to get the beacon id from the data we got from the
ScanRecord
that we get from the scans results in our broadcast receiver (See the code below)We still not able to scan continuously in the background and periodic scans does not fit well on our use case.
ArrayList scanResults = intent.getParcelableArrayListExtra(BluetoothLeScanner.EXTRA_LIST_SCAN_RESULT); ScanRecord record = scanResults.get(0).getScanRecord();
We have a found a workaround for this issue by triggering the background scanning using Google Awareness Fence API and starting the service in charge of scanning as a foreground service using startForegroundService to start the service and then call startInForeground() in the service instance to show a persisting notification indicating the action we are doing in the "background" this approach has worked well for our use case how ever it does it with the cost of showing that notification which does not create a good user experience.
we would like to know if anybody has found a better solution for this issue because from google documentation it looks background scanning is something that definitely we will no be able to do anymore