From a3551a978a5e3d81aa3634b0ae3fddbf6c171caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6the?= Date: Sat, 4 Jul 2026 23:12:42 +0200 Subject: [PATCH] fix: wrap badge example in availability check Update README badge example to guard calls with if #available(iOS 16.0, macOS 13.0, visionOS 1.0, *) { ... } so setBadge/resetBadge are only used on supported OS versions and avoid compile/runtime issues on older platforms. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4530855..1ec4561 100644 --- a/README.md +++ b/README.md @@ -198,8 +198,10 @@ NotificationManager.removeAllDeliveredNotificationRequests() Badge updates are available on iOS 16+, macOS 13+, and visionOS 1+: ```swift -try await NotificationManager.setBadge(badge: 3) -try await NotificationManager.resetBadge() +if #available(iOS 16.0, macOS 13.0, visionOS 1.0, *) { + try await NotificationManager.setBadge(badge: 3) + try await NotificationManager.resetBadge() +} ``` ## Contributing