react-native-easybluetooth-classic icon indicating copy to clipboard operation
react-native-easybluetooth-classic copied to clipboard

issue on ios part

Open nayrskei01 opened this issue 7 years ago • 5 comments
trafficstars

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;

nayrskei01 avatar Oct 11 '18 01:10 nayrskei01

You're right, I'll look into this soon.

douglasjunior avatar Oct 11 '18 11:10 douglasjunior

@douglasjunior will this ever support IOS?

tonmanayo avatar Nov 16 '18 12:11 tonmanayo

@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 avatar Dec 04 '18 16:12 DaBs

@DaBs is right.

douglasjunior avatar Dec 04 '18 16:12 douglasjunior

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 .

nayrskei01 avatar Dec 05 '18 02:12 nayrskei01