Chris Yang 39fd1931c6 [iOS] Add darwin_extension_safe flag and use UIScene api when building for extensions (flutter/engine#43449)
iOS extensions forbids the usage of UIApplication.sharedApplication. This PR refactors the engine to use UISceneAPI when darwin_extension_safe flag is on. Using UISceneAPI can help avoid the usage of `UIApplication.sharedApplication` as much as possible.
This PR also added a new `_extension_safe` variant for the engine build so all the logic with the `darwin_extension_safe` flag is on can be tested separately.

This PR doesn't enable the engine to build for the extension even when darwin_extension_safe is true.

part of https://github.com/flutter/flutter/issues/124289

There are several issues related to UIApplication life cycle and I manually tested they still work with the scene API:

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-01 18:12:45 +00:00
..

Flutter Common

The bottom of the dependency graph for Flutter. Useful for static constants. Please don't put too much in here.