The Swift Package Index logo.Swift Package Index

追踪 Swift 6 严格并发检查对数据竞争安全性的采用情况。有多少 Package 为 Swift 6 做好准备

ScheduledNotificationsViewController

dreymonde/ScheduledNotificationsViewController

当使用 Xcode 项目时

当使用 Swift Package Manager 清单时

选择 package 版本

0.0.5

main


在一个地方查看所有计划的本地通知




ScheduledNotificationsViewController

ScheduledNotificationsViewController 将所有待处理的本地通知集中在一个地方,并提供您所需的所有信息。点击通知会立即触发其传递,这使得这个小工具对于调试本地通知来说非常宝贵。

Medium 文章 请点击这里

已安排 已发送 点击以触发
Scheduled Scheduled Scheduled

特性

  • 在一个地方查看所有已安排的通知:每个通知都包含内容、下次触发日期、标识符和类别名称。
  • 点击列表中的通知会立即触发其传递(您可以实时测试通知的外观)。真实的通知仍然会按时到达!
  • 向下滚动以查看最近发送的通知(点击“显示已发送的通知”)
  • 原生支持浅色和深色模式

用法

import UIKit
import ScheduledNotificationsViewController

// ...somewhere in "Settings" screen:

#if DEBUG

let notificationsVC = ScheduledNotificationsViewController()
self.navigationController?.pushViewController(notificationsVC, animated: true)

#endif

问题排查

问:我的已安排通知列表是空的

答:请确保您已在设备上授予您的应用通知权限。更多信息请参阅: 请求使用通知的权限

问:我点击列表中的通知,但没有任何显示

答:请确保您在 UNUserNotificationCenterDelegate 中使用 userNotificationCenter(_:willPresent:withCompletionHandler:) 回调。更多信息请参阅: 处理通知和与通知相关的操作(参见“处理应用在前台运行时收到的通知”部分)

安装

Swift Package Manager

  1. 点击 File → Swift Packages → Add Package Dependency。
  2. 输入 http://github.com/nicephoton/ScheduledNotificationsViewController.git