We sometimes get asked if it’s possible to use a smartphone as a gateway to scan for Bluetooth devices. The thinking is usually that workers or users already have devices so why not make use of them?
While it is possible, there are many reasons why you might not want to do this:
- On iOS, Apple hide Bluetooth MAC addresses and for some APIs hide the iBeacon ids making unique identification more difficult.
- You will find it very difficult to get a continuously scanning app through Apple app store review. You will need strong justifications.
- Scanning continuously uses lots of battery power, even when advertising with periodic ‘off’ and ‘on’ periods.
- Capabilities of devices vary meaning you will almost certainly get some end user devices where your implementation won’t work. For example, some manufacturers stop long running processes.
- On Android there’s a limit of six scans every 30 seconds. Also, it’s necessary to scan in a foreground activity to prevent the operating system from throttling detections. There are hacks to instead run scanning in threads but these aren’t officially supported and so might not be viable in future OS releases. It’s best not to create production apps based on hacks as they can suddenly stop working.
- Some users will play with their phones and end up purposely or inadvertently disabling your application.
The best scenarios are those where you can dictate the phone type, it can be mains (PSU) powered and the phone isn’t owned by a user (i.e. it’s just used as a gateway). It’s almost always better to use a dedicated gateway.