Skip to content

Commit a4ea737

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
【iOS】Fix timer background state when App is launched from background (#39347)
Summary: Fixes #38711 ## Changelog: [IOS] [FIXED] - Fix timer background state when App is launched from background Pull Request resolved: #39347 Test Plan: Please see #38711 Reviewed By: cipolleschi Differential Revision: D49101979 Pulled By: dmytrorykun fbshipit-source-id: e25b182539f39e4465fa40e51288d88c68967b31
1 parent 0e150d0 commit a4ea737

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-native/React/CoreModules/RCTTiming.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ - (void)setup
128128
_paused = YES;
129129
_timers = [NSMutableDictionary new];
130130
_inBackground = NO;
131+
RCTExecuteOnMainQueue(^{
132+
if (!self->_inBackground && [RCTSharedApplication() applicationState] == UIApplicationStateBackground) {
133+
[self appDidMoveToBackground];
134+
}
135+
});
131136

132137
for (NSString *name in @[
133138
UIApplicationWillResignActiveNotification,

0 commit comments

Comments
 (0)