From 28e18e41058a612290e0cf35c974297522c3ba1f Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Mon, 5 Aug 2019 17:31:13 -0700 Subject: [PATCH] iOS fixed up inconsistent boolean convertion logic in RCTPlatform Summary: For some reason the conversion from a BOOL object to `bool` (C++ style) may lead to incorrect boolean value. This fixes the value provided to the builder to be of `bool` type instead. Reviewed By: JoshuaGross Differential Revision: D16657766 fbshipit-source-id: b66922aceadd20d16226a07f73b24ee0a3b825dc --- React/CoreModules/RCTPlatform.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/CoreModules/RCTPlatform.mm b/React/CoreModules/RCTPlatform.mm index 675e9a4aa80f71..2eeab3dc6a3683 100644 --- a/React/CoreModules/RCTPlatform.mm +++ b/React/CoreModules/RCTPlatform.mm @@ -60,11 +60,11 @@ - (dispatch_queue_t)methodQueue UIDevice *device = [UIDevice currentDevice]; auto versions = RCTGetReactNativeVersion(); return typedConstants({ - .forceTouchAvailable = @(RCTForceTouchAvailable()), + .forceTouchAvailable = RCTForceTouchAvailable() ? true : false, .osVersion = [device systemVersion], .systemName = [device systemName], .interfaceIdiom = interfaceIdiom([device userInterfaceIdiom]), - .isTesting = @(RCTRunningInTestEnvironment()), + .isTesting = RCTRunningInTestEnvironment() ? true : false, .reactNativeVersion = JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder({ .minor = [versions[@"minor"] doubleValue], .major = [versions[@"major"] doubleValue],