AbsaOSS / rn-indy-sdk

This code was starting point of https://github.com/hyperledger/indy-sdk-react-native where the work continues.
Apache License 2.0
11 stars 6 forks source link

Future react native avoid main thread on iOS #23

Closed emberist closed 3 years ago

emberist commented 3 years ago

Just for notice, using the package in iOS the console prints

Module IndySdk requires main queue setup since it overridesinitbut doesn't implementrequiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

Hope it will be useful

TimoGlastra commented 3 years ago

Thanks @riccardocaranfil.

I see it currently is enabled in the Swift side, but not on the objective-c side. That's why the warning is shown I believe.

I think we need to disable main queue setup as they say it is only needed when you use UIKit during init: If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO..

@jakubkoci is there a specific reason main queue setup is currently required?

https://reactnative.dev/docs/native-modules-ios#implementing--requiresmainqueuesetup

jakubkoci commented 3 years ago

@TimoGlastra You're right. We shouldn't need access to the UI thread. I've created PR to fix this #27

@riccardocaranfil Thanks for pointing that out 👍