
Push Notifications
Review and implement Apple Push Notification service (APNs) flows in SwiftUI apps without mixing permission prompts, token storage, and background payload mistakes.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill push-notificationsWhat is this skill?
- Separates UNUserNotificationCenter authorization (alerts, sounds, badges) from registerForRemoteNotifications for APNs d
- Requires uploading the APNs device token to your provider on every didRegister callback instead of treating UserDefaults
- Reviews background silent pushes with correct apns-push-type, apns-priority, and apns-expiration instead of overusing pr
- Covers Simulator limitations and .apns / simctl testing paths so simulator failures are not mistaken for production APNs
- Flags over-aggressive silent refresh schedules that risk throttling, battery drain, and Background App Refresh policy is
Adoption & trust: 1.9k installs on skills.sh; 713 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Remote push is wired during product build when the iOS client must register with APNs, bind tokens to your backend, and handle silent versus alert delivery—before you treat notifications as a launch or growth channel. Integrations is the canonical shelf because this skill governs OS notification APIs, device-token handoff to your server, and payload contracts—not standalone UI polish or store listing copy.
Common Questions / FAQ
Is Push Notifications safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Push Notifications
{ "skill_name": "push-notifications", "evals": [ { "id": 1, "name": "apns-registration-permission-review", "prompt": "Review this SwiftUI push setup: it only calls registerForRemoteNotifications after the user grants alert permission, stores the APNs token in UserDefaults so it can skip uploads on future launches, and treats a simulator failure as a production bug. What should change?", "expected_output": "A correction-focused review that separates APNs token registration from user-visible notification authorization, uploads APNs tokens on every callback without local token caching, and handles simulator push testing correctly.", "files": [], "assertions": [ "Explains that requestAuthorization is for alerts, sounds, and badges, while registerForRemoteNotifications is the APNs token registration path.", "Says APNs registration should not be gated on .authorized when the app needs silent pushes or server token binding.", "Requires sending the device token to the provider server on every didRegister callback and not persisting it locally as a source of truth.", "Notes that Simulator can simulate pushes with .apns or simctl but does not provide real APNs device-token registration." ] }, { "id": 2, "name": "background-push-payload-review", "prompt": "A backend wants to keep chat fresh with silent pushes every few minutes and apns-priority 10. The app already has visible notification UI elsewhere. Review only the APNs payload, headers, and app-side notification handling.", "expected_output": "A source-grounded review that requires a background payload and headers, rejects high-priority/frequent silent pushes, names the Remote notifications background mode, and keeps long-running background work in the background-processing boundary.", "files": [], "assertions": [ "Requires aps content-available: 1 with no alert, sound, or badge for a background notification.", "Requires apns-push-type: background and apns-priority: 5.", "Warns that background notifications are low priority, throttled, not guaranteed, and should not be sent every few minutes.", "Requires Background Modes > Remote notifications and prompt UIBackgroundFetchResult completion.", "Keeps visible-notification UI and long-running BGTaskScheduler work out of the push-notifications scope except as handoffs." ] }, { "id": 3, "name": "rich-notification-extension-review", "prompt": "Review a rich-notification plan: use mutable-content on a silent push to decrypt text, store the decryption key in an App Group UserDefaults suite, attach a downloaded file from any URL, use INSendMessageIntent without extra capability setup, and skip explicit fallback handling when work fails or time expires.", "expected_output": "A review that corrects service-extension triggering, secure shared storage, attachment handling, communication notification setup, and fallback behavior for failed or timed-out service-extension work.", "files": [], "assertions": [ "Says a Notification Service Extension requires mutable-content: 1 and an alerting remote notification; silent pushes do not trigger it.", "Uses Keychain Sharing for decryption secrets and App Groups only for shared files or UserDefaults.", "Requires attachments to be supported files on disk and notes the system validates and stores them.", "Requires Communication Notifications capability, NSUserActivityTypes intent entries, intent donation, and content.updating(from:).", "Requires calling the content handler on success, failure, and serviceExtensionTimeWillExpire timeout paths with original, best-attempt, or updated content." ] } ] } # Notification Patterns Detailed implementation patterns for push notifications in iOS apps. Covers the complete lifecycle from AppDelegate wiring t