我有简单的UILocalNotification
:
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = @"Message";
notification.alertAction = @"Action";
notification.soundName = UILocalNotificationDefaultSoundName;
notification.category = kCategoryIdentifier;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
是否有可能重复一次通知,例如两分钟后?我希望行为卓越,就像在消息应用程序中一样。
我试图设置通知对象的repeatInterval属性,但是:
这不是我所期望的。
此外,由于第二个原因,我不想安排两个单独的通知。
编辑:在我的应用程序时间发生的事情非常重要。因此,在锁定屏幕中,当重复通知时,我希望用户知道这是先前发生的事情,而不是通知到达时。所以重复通知应该有第一次通知的时间戳。< / p>
答案 0 :(得分:0)
是的,您可以设置repeatInterval。
请参阅文档here
重新安排通知的日历间隔。
宣言SWIFT
var repeatInterval: NSCalendarUnit
目标-C
@property(nonatomic) NSCalendarUnit repeatInterval