react-native-easybluetooth-classic
react-native-easybluetooth-classic copied to clipboard
issue on ios part
we are using this on a react native but it crash on ios part since it is only for android. so our work around is to configure the index.js part we add this line of codes. thanks import { NativeModules, DeviceEventEmitter, Platform } from 'react-native';
const EasyBluetooth = undefined; if (Platform.OS === 'android') { EasyBluetooth = NativeModules.EasyBluetoothClassic;
EasyBluetooth.addOnDeviceFoundListener = function (eventCallback) {
return DeviceEventEmitter.addListener(EasyBluetooth.EVENT_DEVICE_FOUND, eventCallback);
}
EasyBluetooth.addOnDataReadListener = function (eventCallback) {
return DeviceEventEmitter.addListener(EasyBluetooth.EVENT_DATA_READ, eventCallback);
}
EasyBluetooth.addOnStatusChangeListener = function (eventCallback) {
return DeviceEventEmitter.addListener(EasyBluetooth.EVENT_STATUS_CHANGE, eventCallback);
}
EasyBluetooth.addOnDeviceNameListener = function (eventCallback) {
return DeviceEventEmitter.addListener(EasyBluetooth.EVENT_DEVICE_NAME, eventCallback);
}
}
module.exports = EasyBluetooth;
You're right, I'll look into this soon.
@douglasjunior will this ever support IOS?
@tonmanayo The issue is that to qualify for using Bluetooth Classic on iOS, you'll need an MFi certified product and you'd be using the EAAccessory protocol instead, which really has very little to do with Bluetooth, apart from it being one of the methods of connecting to such a device. My guess would be no.
@DaBs is right.
this will not support ios.. and it only uses android, you need to filter the os platform for the next time the user will install it it will not crash in ios.
On Wed, 5 Dec 2018 at 12:32 AM Douglas Nassif Roma Junior < [email protected]> wrote:
@DaBs https://github.com/DaBs is right.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/douglasjunior/react-native-easybluetooth-classic/issues/24#issuecomment-444164983, or mute the thread https://github.com/notifications/unsubscribe-auth/ARxjsXnAoaK_K7xxhR6gpSJXVtc2cyq1ks5u1qOngaJpZM4XWn1b .