From f52f97fe4e51f296362c7f234250224c3883acaa Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Sat, 7 Oct 2017 14:15:41 +0300 Subject: [PATCH] Fix RN 0.48+ warning about requiresMainQueueSetup Warning: Module RNDeviceInfo requires main queue setup since it overrides `constantsToExport` but doesn't implement `requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of. --- RNDeviceInfo/RNDeviceInfo.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/RNDeviceInfo/RNDeviceInfo.m b/RNDeviceInfo/RNDeviceInfo.m index 561d80652..d0bd30e92 100644 --- a/RNDeviceInfo/RNDeviceInfo.m +++ b/RNDeviceInfo/RNDeviceInfo.m @@ -15,19 +15,17 @@ @interface RNDeviceInfo() @end @implementation RNDeviceInfo -{ - -} @synthesize isEmulator; RCT_EXPORT_MODULE() - -- (dispatch_queue_t)methodQueue + ++ (BOOL)requiresMainQueueSetup { - return dispatch_get_main_queue(); + return YES; } + - (NSString*) deviceId { struct utsname systemInfo;