react-native-ble-manager icon indicating copy to clipboard operation
react-native-ble-manager copied to clipboard

Problem with writing characteristics on background mode

Open Loovery opened this issue 5 years ago • 1 comments

Version

  • react-native-ble-manager v7.1.4
  • react-native v0.63.2
  • Android v.10

Expected behaviour

Writing data into the characteristic, in the background mode

BleManager.write(id, service, characteristic, data);

Actual behaviour

Nothing happens, not even an error

Steps to reproduce

  1. Connect to the device.
  2. Check that everything works in the active mode.
  3. Changes take place every 5 seconds
  4. Send the application to the background mode (background-timer is started for recording every 5 seconds).
  5. Data is sent to the record, but nothing changes.

AndroidManifest:

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

PermissionsAndroid check

PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION) - true
PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION) - true

Question

What am I doing wrong? How do I send the write in the background correctly?
On iOS works perfectly

Loovery avatar Nov 04 '20 11:11 Loovery

@Looveh did you get it working ? If so, can you tell me ?

franzejr avatar May 02 '21 23:05 franzejr