Prevent DEBUG React Native builds idling out (#37681)

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

User who run their applications using `npx react-native ios` have the application going into the
background if there is inactivity on the device. This is common for users developing on device (why touch
the device if you're tweaking background colours, etc...).

If the application is build with Xcode directly, this is already managed.  This change prevents the idle
timer from running in DEBUG builds.

## Changelog:
[iOS][Fixed] - Debug builds from cli disable idle to stop application going into background

Reviewed By: cipolleschi

Differential Revision: D46427401

fbshipit-source-id: 45969cd506a1b76bde3be81d27808bf0e792a817
This commit is contained in:
Blake Friedman 2023-06-05 03:00:32 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 805604d1e3
Коммит 41d5f4bce2
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -55,6 +55,12 @@ void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled)
#if RCT_NEW_ARCH_ENABLED
RCTEnableTurboModule(turboModuleEnabled);
#endif
#if DEBUG
// Disable idle timer in dev builds to avoid putting application in background and complicating
// Metro reconnection logic. Users only need this when running the application using our CLI tooling.
application.idleTimerDisabled = YES;
#endif
}
UIView *