本文介绍了UI本地通知 - 背景重新安排的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习使用swift开发ios的应用程序,我有一个疑问,已经用Google搜索,我找不到。

I'm learning to develop application for ios with swift, and I'm one doubts, already googled and i not found.

我正在创建一个-do list app,并且想知道是否有办法在用户看来时重新安排通知

I'm creating a to-do list app, and was wondering if there is a way to reschedule a notification when it appears to the user

例如用户每两小时注册一个任务,然后通知显示给用户并试用新通知

For example the user registers a task every two hours, then the notification appears to the user and reagendo the new notification

任何人都可以帮助我吗?

Can anyone help me?

谢谢

推荐答案

如果您的应用被暂停,则无法在后台执行此操作。但UILocalNotification支持循环通知。

您所要做的就是声明重复间隔: notif.repeatInterval = NSDayCalendarUnit;

You can't do it in background if your app is suspended. But UILocalNotification supports recurrent notifications.
All you have to do is to declare the recurring interval: notif.repeatInterval = NSDayCalendarUnit;

你可以找到。

请注意,您无法设置自定义时间间隔。您必须使用默认的的。

Note that you can't set custom intervals. You must use the default ones provided by Apple.

这篇关于UI本地通知 - 背景重新安排的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 14:23