Just wanted to let you know, for anybody else coming here.
I have made an implementation for unity3d.
Open Sourcing it soon 🙂 https://github.com/TobiasFP
@Emil Hey, flicteam. Any idea why this happens or if I can help figure out why connection is lost now and then... Also, that reboot function would be handy for a lot of reasons.
error 1 appears to be "The scan could not be started since bluetooth was not in the powered on state."
Also keep in mind that the state will not be "in the powered on state" if you have forgotten to request for bluetooth permissions in your app, or if the user has rejected the request.
The other permission that you must declare is ACCESS_FINE_LOCATION. Your app needs this permission because a Bluetooth scan can be used to gather information about the location of the user. This information may come from the user's own devices, as well as Bluetooth beacons in use at locations such as shops and transit facilities.