diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f4d62d344cc0..fe85bfc856a4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,8 @@ This is the log of notable changes to the Expo client that are developer-facing. - fixed `BarCodeScanner` blocking UI when defining custom `barCodeTypes` on iOS by [@sjchmiela](https://github.com/sjchmiela) - fixed picking images over 2000px on Android by [@bbarthec](https://github.com/bbarthec) ([#4731](https://github.com/expo/expo/pull/4731)) -- fixed `Calendar.getEventsAsync` crashing if `calendarId` is SQL keyword by [@lukmccall](https://github.com/lukmccall) ([#4836](https://github.com/expo/expo/pull/4836)) +- fixed `Calendar.getEventsAsync` crashing if `calendarId` is SQL keyword by [@lukmccall](https://github.com/lukmccall) ([#4836](https://github.com/expo/expo/pull/4836)) +- fixed `BOOL` interpretation on 32-bit iOS devices by [@lukmccall](https://github.com/lukmccall) ([#4862](https://github.com/expo/expo/pull/4862)) ## 33.0.0 diff --git a/packages/@unimodules/core/ios/UMCore/UMExportedModule.m b/packages/@unimodules/core/ios/UMCore/UMExportedModule.m index 7355359542b55..3f99fd39a379e 100644 --- a/packages/@unimodules/core/ios/UMCore/UMExportedModule.m +++ b/packages/@unimodules/core/ios/UMCore/UMExportedModule.m @@ -149,12 +149,22 @@ - (void)callExportedMethod:(NSString *)methodName withArguments:(NSArray *)argum if (obj != [NSNull null]) { [invocation setArgument:&obj atIndex:(2 + idx)]; } + + // According to objc.h, the BOOL type can be represented by `bool` or `signed char` so + // getArgumentTypeAtIndex can return _C_BOOL (when `bool`) or _C_CHR (when `signed char`) +#if OBJC_BOOL_IS_BOOL if ([methodSignature getArgumentTypeAtIndex:(2 + idx)][0] == _C_BOOL) { // We need this intermediary variable, see // https://stackoverflow.com/questions/11061166/pointer-to-bool-in-objective-c BOOL value = [obj boolValue]; [invocation setArgument:&value atIndex:(2 + idx)]; } +#else // BOOL is represented by `signed char` + if ([methodSignature getArgumentTypeAtIndex:(2 + idx)][0] == _C_CHR){ + BOOL value = [obj charValue]; + [invocation setArgument:&value atIndex:(2 + idx)]; + } +#endif }]; [invocation setArgument:&resolve atIndex:(2 + [arguments count])]; [invocation setArgument:&reject atIndex:([arguments count] + 2 + 1)];