feat: notify once per newly available version - #98
Merged
Conversation
The Update Available notice lives at the top of the right-click menu and in Settings → Other, so a user who rarely opens either can miss a release for weeks. Post a system notification the first time an automatic check discovers a given version — once per version, keyed in UserDefaults, so the daily re-check never re-nags. Manual checks stay silent (their result is already on screen), and the banner is retired once the update is installed, both at the next check and at launch.
- Install a UNUserNotificationCenterDelegate at launch and route the update banner's stable identifier to openLatestReleasePage; the body text becomes just "Click to open the download page." - Record the announced version only once the banner is accepted for delivery, so the launch-time permission race (or denied notifications) can't permanently swallow a version's announcement — the next automatic check retries instead. - README documents the click action.
|
🎉 This PR is included in version 2.25.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Update Available notice sits at the top of the right-click menu and in Settings → Other, so a user who rarely opens either can miss a release for weeks. This posts a system notification the first time an automatic check discovers a given version.
UNUserNotificationCenterDelegateinstalled at launch routes the stable identifier to the existingopenLatestReleasePagehandler. Every other notification stays informational and just dismisses.com.magicswitch.updatecheck.notifiedVersion) once the banner is accepted for delivery, so the daily re-check and hourly retries never re-nag — while a post swallowed by the launch-time permission prompt (or by denied notifications) stays eligible for the next automatic check.update-available): re-posts replace rather than stack, and the delivered banner is retired once the update is installed (checked at launch and after every successful check), matching the Bluetooth-Off alert's stale-banner handling.README's Updates section documents the notification and the click action. Not built in Xcode here, but
swiftc -typecheckagainst the macOS SDK passes — please build before merging.