You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

react-native+0.63.4.patch 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. diff --git a/node_modules/react-native/React/CoreModules/RCTTiming.mm b/node_modules/react-native/React/CoreModules/RCTTiming.mm
  2. index 7517771..5af8bdc 100644
  3. --- a/node_modules/react-native/React/CoreModules/RCTTiming.mm
  4. +++ b/node_modules/react-native/React/CoreModules/RCTTiming.mm
  5. @@ -148,6 +148,11 @@ - (void)setup
  6. name:name
  7. object:nil];
  8. }
  9. +
  10. + [[NSNotificationCenter defaultCenter] addObserver:self
  11. + selector:@selector(proximityChanged)
  12. + name:UIDeviceProximityStateDidChangeNotification
  13. + object:nil];
  14. }
  15. - (void)dealloc
  16. @@ -184,6 +189,16 @@ - (void)appDidMoveToForeground
  17. [self startTimers];
  18. }
  19. +- (void)proximityChanged
  20. +{
  21. + BOOL isClose = [UIDevice currentDevice].proximityState;
  22. + if (isClose) {
  23. + [self appDidMoveToBackground];
  24. + } else {
  25. + [self appDidMoveToForeground];
  26. + }
  27. +}
  28. +
  29. - (void)stopTimers
  30. {
  31. if (_inBackground) {