alexkendall / react-native-bluetooth-cross-platform

Cross-Platform Bluetooth & WiFi React Native Module. Powered by underdark http://underdark.io/.
179 stars 35 forks source link

How do I retrieve incoming messages? #49

Open bharadwajpro opened 5 years ago

bharadwajpro commented 5 years ago

The addReceivedMessageListener(callback) takes a callback function which returns only id, type, connected, display name according to documentation. Then how do I retrieve the incoming message?

EthanCannoy commented 4 years ago

The callback actually returns many more fields. Inside of the returned user object is a message field.

_recievedMessage(user) { console.log('message received: ', user.message); }