diff --git a/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m b/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m index d9387c4..a487da0 100644 --- a/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m +++ b/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m @@ -165,10 +165,10 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error NSNumber *socketID = [webSocket reactTag]; _contentHandlers[socketID] = nil; _sockets[socketID] = nil; - [self sendEventWithName:@"websocketFailed" body:@{ - @"message": error.localizedDescription, - @"id": socketID - }]; + NSDictionary *body = + @{@"message" : error.localizedDescription ?: @"Undefined, error is nil", + @"id" : socketID ?: @(-1)}; + [self sendEventWithName:@"websocketFailed" body:body]; } - (void)webSocket:(RCTSRWebSocket *)webSocket diff --git a/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm b/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm index bd48f44..d243ed0 100644 --- a/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -767,7 +767,7 @@ - (void)registerExtraLazyModules #endif } -- (NSArray *)_initializeModules:(NSArray> *)modules +- (NSArray *)_initializeModules:(NSArray *)modules withDispatchGroup:(dispatch_group_t)dispatchGroup lazilyDiscovered:(BOOL)lazilyDiscovered { diff --git a/node_modules/react-native/React/Modules/RCTTiming.m b/node_modules/react-native/React/Modules/RCTTiming.m index 8a09022..265d7b6 100644 --- a/node_modules/react-native/React/Modules/RCTTiming.m +++ b/node_modules/react-native/React/Modules/RCTTiming.m @@ -130,6 +130,11 @@ - (void)setBridge:(RCTBridge *)bridge object:nil]; } + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(proximityChanged) + name:UIDeviceProximityStateDidChangeNotification + object:nil]; + _bridge = bridge; } @@ -276,6 +281,16 @@ - (void)didUpdateFrame:(RCTFrameUpdate *)update } } +-(void)proximityChanged +{ + BOOL near = [UIDevice currentDevice].proximityState; + if (near) { + [self appDidMoveToBackground]; + } else { + [self appDidMoveToForeground]; + } +} + - (void)scheduleSleepTimer:(NSDate *)sleepTarget { @synchronized (self) { diff --git a/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index 3cb73b5..e4a14b4 100644 --- a/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -297,7 +297,7 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name @"%@ has no setter or ivar for its bridge, which is not " "permitted. You must either @synthesize the bridge property, " "or provide your own setter method.", - RCTBridgeModuleNameForClass(module)); + RCTBridgeModuleNameForClass(Class(module))); } }