Skip to content

feat: notify once per newly available version - #98

Merged
MegaManSec merged 2 commits into
mainfrom
feat/update-available-notification
Aug 7, 2026
Merged

feat: notify once per newly available version#98
MegaManSec merged 2 commits into
mainfrom
feat/update-available-notification

Conversation

@MegaManSec

@MegaManSec MegaManSec commented Aug 6, 2026

Copy link
Copy Markdown
Owner

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.

  • Clicking the banner opens the download page: a UNUserNotificationCenterDelegate installed at launch routes the stable identifier to the existing openLatestReleasePage handler. Every other notification stays informational and just dismisses.
  • Once per version: the announced version is persisted (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.
  • Manual checks stay silent — their result is already on screen next to the button.
  • Stable identifier (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.
  • Denied notifications: like every other Magic Switch notification it just doesn't appear, and the existing "Notifications are off" warning in Settings → Other covers that case.

README's Updates section documents the notification and the click action. Not built in Xcode here, but swiftc -typecheck against the macOS SDK passes — please build before merging.

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.
@MegaManSec
MegaManSec merged commit d7a1894 into main Aug 7, 2026
2 checks passed
@MegaManSec
MegaManSec deleted the feat/update-available-notification branch August 7, 2026 06:55
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.25.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@MegaManSec MegaManSec changed the title Notify once per newly available version feat: notify once per newly available version Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant