← ClaudeAtlas

push-notificationslisted

Implement, review, or debug push notifications in iOS/macOS apps — local notifications, remote (APNs) notifications, rich notifications, notification actions, silent pushes, and notification service/content extensions. Use when working with UNUserNotificationCenter, registering for remote notifications, handling notification payloads, setting up notification categories and actions, creating rich notification content, or debugging notification delivery. Also use when working with alerts, badges, sounds, background pushes, or user notification permissions in Swift apps.
dpearson2699/swift-ios-skills · ★ 640 · Code & Development · score 81
Install: claude install-skill dpearson2699/swift-ios-skills
# Push Notifications Implement, review, and debug local and remote notifications on iOS/macOS using `UserNotifications` and APNs. Covers permission flow, token registration, payload structure, foreground handling, notification actions, grouping, and rich notifications. Targets iOS 26+ with Swift 6.3, backward-compatible to iOS 16 unless noted. ## Contents - [Permission Flow](#permission-flow) - [APNs Registration](#apns-registration) - [Local Notifications](#local-notifications) - [Remote Notification Payload](#remote-notification-payload) - [Notification Handling](#notification-handling) - [Notification Actions and Categories](#notification-actions-and-categories) - [Notification Grouping](#notification-grouping) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Permission Flow Request notification authorization before doing anything else. The system prompt appears only once; subsequent calls return the stored decision. ```swift import UserNotifications @MainActor func requestNotificationPermission() async -> Bool { let center = UNUserNotificationCenter.current() do { let granted = try await center.requestAuthorization( options: [.alert, .sound, .badge] ) return granted } catch { print("Authorization request failed: \(error)") return false } } ``` ### Checking Current Status Always check status before assuming permissions. The user can chang