Skip to content

Fix requiresMainQueueSetup warnings #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

christophermark
Copy link
Contributor

Overview

This fixes some of the warnings we were getting about requiring main queue setup in our native modules, by explicitly setting whether our native modules can be loaded in the background.

Prior art:

https://github.com/wix/react-native-navigation/pull/1983/files
facebook/react-native@220034c
invertase/react-native-firebase#491

@@ -10,6 +10,11 @@ @interface RNFrequency ()
@implementation RNFrequency
RCT_EXPORT_MODULE(Frequency);

+ (BOOL)requiresMainQueueSetup
{
return NO;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know enough about TGSineWaveToneGenerator's initialization process for it to safely initialize on a non-main thread? YES might be a safe fallback

Copy link
Contributor Author

@christophermark christophermark Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christophermark christophermark force-pushed the fix-requiresMainQueueSetup-warning branch from 5f45d26 to d44b9d5 Compare October 9, 2019 14:52
@christophermark
Copy link
Contributor Author

Updated to preserve functionality - this is now run in the main thread.

@christophermark christophermark merged commit 42b1a09 into robinpowered:master Oct 14, 2019
@christophermark christophermark deleted the fix-requiresMainQueueSetup-warning branch October 14, 2019 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants