返回 Skill 列表
extension
分类: 开发与工程无需 API Key

iOS Notifications

使用UserNotifications框架和APNS为iOS推送通知。在将APNS推送通知集成到iOS应用程序时使用。

person作者: jakexiaohubgithub

iOS Notifications

Priority: P2 (MEDIUM)

Guidelines

  • Framework: Use UserNotifications for all notification handling.
  • Delegate: Implement UNUserNotificationCenterDelegate for foreground & tap handling.
  • Permissions: Request .alert, .badge, .sound after priming user.
  • APNs: Register for remote notifications in AppDelegate.
  • Badges: Manage app icon badges manually (set to 0 to clear).

See APNs registration and permission examples

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.

References

Canonical response anchors

When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:

  • Framework
  • Permissions

Remediation anchors

  • Remediation anchors: UNUserNotificationCenterDelegate, .alert, .badge, .sound