fix(ios): prevent duplicate Application suspend/resume events when using UIScenes#11269
Conversation
|
View your CI Pipeline Execution ↗ for commit 7e0aa9f
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
@jcassidyav can you detail the concern about UIApplicationDidBecomeActiveNotification usage? If it was used in any way an issue |
|
@farfromrefug when Scenes are enabled as per #10786, the notifications In core they were both captured and executed the same code, resulting in duplicate events etc. The decision is then which one to use, and it seems that from https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle the move is away from the UIApplication events, when the scene-based life cycle is enabled. |
|
@jcassidyav thanks I understand. |
PR Checklist
What is the current behavior?
When using Scenes as per #10786 the Application resume and suspend events are fired twice ( along with other logic ).
This is because the UIApplicationDidBecomeActiveNotification &
UIApplicationDidEnterBackgroundNotificationnotifications are fired in addition to the Scene notifications.What is the new behavior?
If scenes are supported, then the notifications
UIApplicationDidBecomeActiveNotification&UIApplicationDidEnterBackgroundNotificationare not subscribed to.The only code that is not duplicated in the scene events is the call to
notifyAppStartedbut this appears to the handled by the changes in #11149. The slight concern would be that theUIApplicationDidBecomeActiveNotificationwas handling it in some scenarios.closes #11268