wbreeze / ShipsClock

An iOS, SwiftUI clock for tracking watches on board a ship. Marks the day in periods of four hours.
https://wbreeze.github.io/ShipsClock
Apache License 2.0
2 stars 0 forks source link

Cancel notifications on exit from background #13

Closed wbreeze closed 3 years ago

wbreeze commented 4 years ago

When the app is closed from the background, it does not cancel the bell notifications. It lives like a poltergeist, continuing to play ships bells.

The work-around is to bring the app to the foreground first, before dismissing it.

Clear the notifications on exit from the background.

wbreeze commented 4 years ago

The UIWindowSceneDelegate function sceneDidDisconnect is not called when dismissing the application from the app switcher unless the app was in foreground when activating the switcher. The same is true for the UIApplicationDelegate function applicationWillTerminate.

https://stackoverflow.com/questions/60205568/scenediddisconnect-not-called-when-user-close-the-window-in-switcher

https://developer.apple.com/forums/thread/653716

wbreeze commented 3 years ago

This was resolved with iOS 14, but iOS 15 no longer plays the notifications at all. See #31