Notifications

From moasq/nanowave · View interactive version

Notifications is an AI agent skill from the GitHub repository moasq/nanowave. Local notifications: permission states, scheduling, badge management, UserNotifications framework. Use when implementing app features related to notifications.

How to use this skill

Skill file

Notifications

NOTIFICATIONS (LOCAL — no server needed):

FRAMEWORK: UserNotifications — UNUserNotificationCenter.current()

PERMISSION STATES (CRITICAL — must handle ALL four states):

  1. NOT DETERMINED: Call .requestAuthorization(options: [.alert, .badge, .sound]). System shows dialog.
  2. AUTHORIZED: Schedule notifications normally.
  3. DENIED: App CANNOT re-request permission. Must redirect user to System Settings.
  4. PROVISIONAL: Quiet notifications — treat as authorized.

PERMISSION IS SYSTEM-CONTROLLED (CRITICAL):

UI THAT DISPLAYS NOTIFICATION STATUS (in ANY view — must handle ALL three states):

RE-CHECK ON FOREGROUND (CRITICAL):

Any view displaying notification status MUST re-check when the app returns to foreground.

The user may have changed permissions in System Settings while the app was backgrounded.

.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in

Task {

let settings = await UNUserNotificationCenter.current().notificationSettings()

isNotificationsEnabled = (settings.authorizationStatus == .authorized || settings.authorizationStatus == .provisional)

}

}

SCHEDULING:

BADGE COUNT:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.