ios - 不同时间重复通知

标签 ios swift uilocalnotification nsnotificationcenter

我在上午 10:00 创建了一个本地通知,我想在下一次触发第一个通知时根据计算重复通知。

那么如何监听通知触发器来创建下一个通知呢?

注意:我使用了 didRecieve 通知委托(delegate),但它仅在前台的应用程序我想在后台使用相同的东西时才有效。

最佳答案

时间间隔触发器就可以了。

https://developer.apple.com/documentation/usernotifications/untimeintervalnotificationtrigger

Use a UNTimeIntervalNotificationTrigger object for local notifications that you want delivered at a time relative to the current time. You specify the number of seconds that must elapse before the notification fires. You can also set up the trigger to repeat at the specified interval.

关于ios - 不同时间重复通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50000398/

相关文章:

swift - 在 Swift 中,为什么同名的实例参数和类函数会产生无效的重声明错误?

ios - 收到通知时点击打开本地通知 - iOS - Swift

ios - 如何在iOS中显示钻石形状的图像?

iOS UIView继承性能差

jquery - 加快 iPhone 上 jQuery Mobile 的对话框/页面转换速度?

ios - 如何调用另一个 Storyboard作为弹出窗口?

ios - Swift - 推送通知 JSON 格式

ios - 应用程序未运行或终止时的通知

ios - 处于非事件应用程序状态时的本地通知

iphone - 在 appDelegate.m 中设置导航 Controller 和 tabBarController