-
Notifications
You must be signed in to change notification settings - Fork 2
Notification
FengYan枫炎 edited this page Jun 30, 2025
·
3 revisions
提供了对 iOS 本地通知系统的访问,包括初始化通知系统、推送定时通知、移除待定通知等功能。
本地定时通知需要在Apple Dev网站配置App的相关权限,具体方法查找互联网。
初始化通知系统,不需要显式调用,当调用类中的其他方法时会自动初始化。
推送本地定时通知。
-
msg
– 通知的内容。 -
title
– 通知的标题。 -
identifier
– 为通知指定的标识符,相同的标识符会被系统判定为同一个通知。 -
delay
– 延迟的时间,单位为秒。通知将在延迟后推送。
上面的重载版本,支持设置repeats,循环推送通知
支持在指定日期或时间触发通知,见 Apple UNCalendarNotificationTrigger
上面的重载版本,支持设置repeats,可通过NSCalendarUnit指定在何时循环推送通知
DateTime tmr= DateTime.Today.AddDays(1); //明天 var component = new NSDateComponents(NSCalendarUnit.Weekday | NSCalendarUnit.Hour | NSCalendarUnit.Minute | NSCalendarUnit.Second, tmr); Notification.PushNotification("通知内容", "通知标题(可留空string)", "通知标识符", component , true);
移除某个待定通知。
-
identifier
– 要移除的通知的标识符。
移除所有待定通知。
本Wiki包含插件中各个类各个方法的详细介绍,内容可能不完整,尚待补全。如果代码有问题,本人欢迎各位提交Issue以及PR。Wiki内容以最新版本为准。