When launching my iOS App built with react-native, I get the following warning:
Module iCloudStorage requires main queue setup since it overrides
constantsToExport
but 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.
I've been searching around to find a solution but the only thing I found was this:
add requiresMainQueueSetup to prevent warning and future side-effects in RCCManagerModule
It says I should add the following snippet to ios/RCCManagerModule.m
(BOOL)requiresMainQueueSetup
{
return YES;
}
There is no RCCManagerModule.m
file in my react-native project.
Is there any other solution to this?
And if possible, could someone explain me what does this error actually says/means: what is main queue setup in this context?
Currently the maintainer of react-native-audio has said he's not maintaining the project anymore, so it is unlikely to be fixed unless someone volunteers to take over maintenance. Apparently it should not affect behavior. See this discussion.
But as shown on the video mentioned in the above discussion, you can go to node_modules/react-native-audio/ios/AudioRecorderManager.m, and before the line
- (void)stopProgressTimer {
, insert this code:That eliminates the warning.