Driversnote-Dev / react-native-kontaktio

React Native (iOS and Android) library for Kontakt.io beacons (and all other beacons)
MIT License
112 stars 48 forks source link

Run KontaktBeacons in background thread instead of main thread #33

Open JonasWho opened 6 years ago

JonasWho commented 6 years ago

React Native will eventually, in future versions, demand that plugins opt in or out of running on the main thread. I get this Warning when running react-native-kontaktio in RN 0.52.0:

Module KontaktBeacons requires main queue setup since it overridesconstantsToExportbut 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.

pashute commented 6 years ago

perhaps the heading of this issue should be: Run KontaktBeacons on a background thread

no?

Gloix commented 6 years ago

I need it to run in background thread :/

My main thread: profiling mantencion

andrekovac commented 5 years ago

This thread explains the issue nicely.

The solution to get rid of this warning is probably to add:

+ (BOOL)requiresMainQueueSetup
{
    return NO;
}