Skip to content

Commit 5c24599

Browse files
Alex Cohenfacebook-github-bot
authored andcommitted
name background tasks
Summary: [iOS] [Changed] - background tasks need names in order to track them. Reviewed By: aditya7fb Differential Revision: D15604435 fbshipit-source-id: 098e28620b75860c0e39166639399bbbcd42ff2b
1 parent 7f489b6 commit 5c24599

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

React/Modules/RCTTiming.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ - (void)markStartOfBackgroundTaskIfNeeded
147147
if (_backgroundTaskIdentifier == UIBackgroundTaskInvalid) {
148148
__weak typeof(self) weakSelf = self;
149149
// Marks the beginning of a new long-running background task. We can run the timer in the background.
150-
_backgroundTaskIdentifier = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
150+
_backgroundTaskIdentifier = [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"rct.timing.gb.task" expirationHandler:^{
151151
typeof(self) strongSelf = weakSelf;
152152
if (!strongSelf) {
153153
return;
@@ -365,7 +365,7 @@ - (void)timerDidFire
365365
@synchronized (_timers) {
366366
_timers[callbackID] = timer;
367367
}
368-
368+
369369
if (_inBackground) {
370370
[self markStartOfBackgroundTaskIfNeeded];
371371
[self scheduleSleepTimer:timer.target];

0 commit comments

Comments
 (0)