Description
Environment
- CLI: 6.4.2
- Cross-platform modules: @nativescript/core 6.4.2
- Android Runtime: -
- iOS Runtime: 6.4.2
- Plugin(s): -
Describe the bug
When you suspend the NativeScript app on an iOS 13 device/simulator, the suspend-event will be triggered as expected, but then thesystemAppearanceChanged
event will be triggered twice, one time with the opposite of the current dark-mode setting, and then with the current setting of darkmode.
That happens even if the user made no changes in the dark mode settings of the device.
This issue does not occur on Android devices and iOS 12. Only the suspend-Event gets triggered on those devices, as expected.
To Reproduce
1.) Start the demo app provided below on a
2.) suspend the app and you will see some logs in the console:
suspendEvent
systemAppearanceChangedEvent: dark
systemAppearanceChangedEvent: light
If the dark mode is activated on the iOS 13 device bevore suspending the app, then the 2nd and the 3rd log come in reversed order.
Expected behavior
The systemAppearanceChanged event should not be triggered at all in this scenario (only the suspend-Event should be triggered).
Sample project
NSSystemAppearanceIssueIOS.zip