Repository navigation
Add turbo modules support - #1285
Conversation
…ded example apps yarn locks.
…ded example apps yarn locks.
|
Hi, I migrated the Android side but the swift side is not so simple. The documentation and the examples are not correct (https://github.com/react-native-community/RNNewArchitectureLibraries/tree/feat/swift-event-emitter) so I have to find out other examples. |
I guess we can still use the same RctEventEmitter or am i wrong about that? |
…spec to support both architechtures, fix imports on ios.
Actually i'm wrong about that, look: react-native-community/RNNewArchitectureLibraries#19 (comment) |
|
Also i guess we will probably have to add typesafety in all events to be able to send events to codegen. |
|
Hey @marcosinigaglia, just like @Marvedog I am also going to test this out over the next days for a new arch app we're building. Will let you know if anything strange pops up! Thanks for the great work! |
Ok, i'll check on the devices that i have here. |
|
I've tested with a real app ios/android and after few fixes it (12.0.0-rc.2) it seems working. I am waiting for a few more tests to merge. |
|
I got an error in Xcode with version https://github.com/lucaswitch/react-native-ble-manager/pull/1 |
NativeEventEmitter is not necessary with the new event management
Added the rejection of the start promise to prevent crash
Your fix is working only if you use |
|
Excited to test this as well! |
|
Hi! Thanks a lot for the work. I did a try and I had this error when testing rc3 and using did the API to listen to ble events has changed ? |
|
Jumping in to report that
@matt-42, looks like the answer is "yes" -- see https://github.com/innoveit/react-native-ble-manager/pull/1285/files#diff-0a0e6737f721e95ba0e323dbf727fa099aa28bf25c147fd3fdd7ea36f8dc7e0a. Thanks for the tip! Previously I had to instantiate a // Before ( <= v11.5.7)
import { NativeEventEmitter, NativeModules } from 'react-native';
import BleManager from 'react-native-ble-manager';
const BleManagerModule = NativeModules.BleManager || {};
const BleEvents = new NativeEventEmitter(BleManagerModule);
BleManager.start();
const subscription = BleEvents.addListener(
'BleManagerDiscoverPeripheral',
(device) => { /* do stuff */ },
);Now, there are easy-to-use methods directly available on the // After ( >= v12.0.0)
import BleManager from 'react-native-ble-manager';
BleManager.start();
const subscription = BleManager.onDiscoverPeripheral(
(device) => { /* do stuff */ }
); |



This PR is still on development process so things can be broken.
Things are being done using the official docs and keeping backwards compat in mind.
New arch support can be tested using the examplenewarch app and old arch using the default example app.
Reference: https://github.com/reactwg/react-native-new-architecture/blob/main/docs/appendix.md