Hi. The button will not just send data by itself. You need to pair and initiate transmission first.
I suggest you to look at our protocol specification at https://github.com/50ButtonsEach/flic2-documentation.
If you can't use the flic2lib-android directly, you can at least look at the source code at https://github.com/50ButtonsEach/flic2lib-android/blob/master/flic2lib-android/src/main/java/io/flic/flic2libandroid/Flic2Button.java and try to port it to C#. The code follows the protocol specification.
Ionic and Flic2 is a perfect match, since there is a very good BLE Gatt library that you can use.
This one is the simplest one to use, but is very limited:
I would recommend using this one, by Rand Dusing:
@anton said in Error code 1 on scan:
@info-6 All flic2lib.buttonscanner error codes are documented here: https://github.com/50ButtonsEach/flic2lib-ios/wiki/Documentation#flicbuttonscannererrorcode
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.
Please read https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions:
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.
Hi, just use this method: https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#isEnabled(). Or use https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#ACTION_STATE_CHANGED to listen to state changes.
Strange. I tested it just now on iOS 13.3.1 and it works.
- (void)button:(FLICButton *)button didDisconnectWithError:(NSError *)error;
And you are sure that the delegates are set properly and that you are not accidentally calling on a nil-object or something?