question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

monitorCharacteristicForDevice works fine on IOS but not on Android

See original GitHub issue

Attempting to monitor changes and get the listener callback to fire when my hardware notifies the phone.

This code works as expected on IOS but I get no response from the listener on Android.

Followed these docs: https://polidea.github.io/react-native-ble-plx/#BleManager#monitorCharacteristicForDevice

Is there any known difference in functionality between the platforms? I’ve been digging around and logging out data in BleModule.java to try and get some feedback but I’m not getting anywhere.

Has anyone else had this problem?

These are my versions: "react-native": "^0.47.0-rc.1", "react-native-ble-plx": "^0.6.3",

The code in question:

let thisSubscription = this.manager.monitorCharacteristicForDevice(this.connectedDevice.id, this.serviceUUID, this.tagCharacteristicUUID, (err, characteristic) => {
  // console.log('monitorCharacteristicForDevice fires once');
  if(err) {
    console.log('Err from pen', err);
    return
  }
  console.log('data from pen: ', characteristic);
  let tagValue = utils.base64toHEX(characteristic.value)
  console.warn('Tag data: ', tagValue);
})

console.log('thisSubscription', thisSubscription);`

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Cierpliwycommented, Jul 31, 2018

In version 0.8.0 I created a workaround, which caused some issues on our side. That’s why I reverted it. I think that this should be fixed in RxAndroidBle directly and probably will look into it on Friday (my open source days).

2reactions
dariuszseweryncommented, Sep 13, 2018

Sit tight, I am currently working on the solution 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

monitorCharacteristicForDevice works fine on IOS but not on ...
Attempting to monitor changes and get the listener callback to fire when my hardware notifies the phone. This code works as expected on...
Read more >
RxBLELibraries/react-native-ble - Gitter
Hello all ! My team and I are going to create a bluetooth app for android and ios with React-Native. I was wandering...
Read more >
react-native-ble-plx 2.0.2 | Documentation
Characteristic is a container for a value which can be read, written and monitored based on available capabilities. For example connection may look...
Read more >
Highest scored 'react-native-ble-plx' questions - Page 2
I am trying to pair a gateway to React native app using the react-native-ble-plx. The below source code works fine in Android wheras...
Read more >
react-native-ble-plx - npm
... data type on Android. Don't emit state changes when BLE is not supported. ... Both on iOS and Android continue manually from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found