简体   繁体   English

如果用户修改日期/时间,iOS是否会使localNotifications无效

[英]Does iOS invalidates localNotifications if the user modifies the date/time

If current date is 20-November-2012 9:00 AM, in my app if I schedule a local notification with firedate say 21-November-2012 10:00 AM and run my application and if I modify the date/time in settings to some previous date say 18-November-2012 I will get the notification properly when the date/time reaches the firedate. 如果当前日期是2012年11月20日上午9:00,则在我的应用中,如果我安排了带有firedate的本地通知,请说2012年11月21日上午10:00并运行我的应用程序,并且如果我将设置中的日期/时间修改为以前的某个日期说2012年11月18日,当日期/时间达到触发日期时,我会正确地收到通知。

But if I change the date/time to any upcoming date say 30-November-2012 10::PM in device settings I am not getting the notification. 但是,如果我将日期/时间更改为任何即将到来的日期,请在设备设置中说2012年11月30日10 :: PM,则不会收到通知。 Does iOS invalidates localNotifications if the user sets the the date/time to any upcoming date. 如果用户将日期/时间设置为任何即将到来的日期,iOS是否会使localNotifications无效。

When you fire a LocalNotification that notification will get registered into the OS.OS present the notification on time.You can see the notifications your App has registered using the code 当您触发LocalNotification时,该通知将被注册到OS中.OS会及时显示该通知。您可以使用以下代码查看您的App已注册的通知

`[[UIApplication sharedApplication] scheduledLocalNotifications]`

You CANT edit any notification that is already registered in the OS. 你不能编辑在OS已经注册的任何通知。

If you want to edit any notification , cancel the previous notification and fire a new one using the updated firedate. 如果您要编辑任何通知,请取消先前的通知,并使用更新的触发日期触发新的通知。

I never understood how you get a notification in 18-November-2012 if the current date is 20-November-2012 9:00 AM. 如果当前日期为2012年11月20日上午9:00,我永远不会理解您如何在2012年11月18日收到通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM