home / skills / hoangnguyen0403 / agent-skills-standard / ios-notifications
This skill helps implement iOS push notifications using UserNotifications and APNs, including foreground handling and permissions workflow.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill ios-notificationsReview the files below or copy the command above to add this skill to your agents.
---
name: iOS Notifications
description: Push notifications for iOS using UserNotifications framework and APNS.
metadata:
labels: [ios, apns, notifications, push, user-notifications]
triggers:
files: ['**/*Notification*.swift', '**/*AppDelegate.swift']
keywords:
[UNUserNotificationCenter, APNS, UNNotificationRequest, deviceToken]
---
# iOS Notifications
## **Priority: P2 (OPTIONAL)**
Push notifications using UserNotifications framework and APNs.
## Guidelines
- **Framework**: Use `UserNotifications` for all notification handling.
- **Delegate**: Implement `UNUserNotificationCenterDelegate` for foreground & tap handling.
- **Permissions**: Request `.alert`, `.badge`, `.sound` after priming the user.
- **APNs**: Register for remote notifications in `AppDelegate`.
- **Badges**: Manage app icon badges manually (set to 0 to clear).
[Implementation Details](references/implementation.md)
## Anti-Patterns
- **No Unconditional Requests**: Explain value proposition before system dialog.
- **No Missing Delegate**: Notifications won't trigger foreground callbacks without it.
- **No Forgotten Badge Clear**: User frustration increases if badges persist.
## Related Topics
ios-navigation | ios-design-system | mobile-ux-core
This skill documents best practices for implementing iOS push notifications using the UserNotifications framework and APNs. It focuses on correct setup, permission flow, delegate handling, and badge management to deliver reliable and user-friendly notifications. The guidance is practical and geared toward TypeScript/Swift hybrid projects and cross-platform teams.
It prescribes using UserNotifications for all local and remote notification handling and registering the app with APNs via AppDelegate. It requires implementing UNUserNotificationCenterDelegate to handle foreground presentation and user interactions. It also covers requesting permissions after priming users and manually managing app icon badges.
Do I need UNUserNotificationCenterDelegate?
Yes. Without the delegate, the app won’t receive foreground presentation callbacks or user tap handling reliably.
When should I request permissions?
Prime users with an in-app explanation of value, then call the system permission prompt. Avoid unconditional requests at first launch.