【iOS】Fix timer background state when App is launched from background (#39347)

Summary:
Fixes https://github.com/facebook/react-native/issues/38711

## Changelog:

[IOS] [FIXED] - Fix timer background state when App is launched from background

Pull Request resolved: https://github.com/facebook/react-native/pull/39347

Test Plan: Please see https://github.com/facebook/react-native/issues/38711

Reviewed By: cipolleschi

Differential Revision: D49101979

Pulled By: dmytrorykun

fbshipit-source-id: e25b182539f39e4465fa40e51288d88c68967b31
This commit is contained in:
zhongwuzw
2023-09-11 05:17:15 -07:00
committed by Facebook GitHub Bot
parent 0e150d071e
commit a4ea737ae1
@@ -128,6 +128,11 @@ RCT_EXPORT_MODULE()
_paused = YES;
_timers = [NSMutableDictionary new];
_inBackground = NO;
RCTExecuteOnMainQueue(^{
if (!self->_inBackground && [RCTSharedApplication() applicationState] == UIApplicationStateBackground) {
[self appDidMoveToBackground];
}
});
for (NSString *name in @[
UIApplicationWillResignActiveNotification,