iPhone关闭时的UILocalNotification [英] UILocalNotification when iPhone switched off
问题描述
当设备关闭时安排UILocalNotofication会发生什么。
What happens when a UILocalNotofication is scheduled when a device is switched off.
例如。我每天下午3点安排一次UILocalNotification。但该设备从下午3:00到下午4:00关闭。我猜以下任何一种情况都属实。
Eg. I schedule a UILocalNotification at 3pm everyday. But the device is switched off from 3:00pm to 4:00pm. I guess any one of the following conditions will be true.
- 设备重启后没有通知。
- 重启设备时会触发通知,即下午4:00
我没有设备且无法测试它在模拟器上。
I do not have a device and could not test it on a simulator.
注意:关闭我意味着设备已关闭,而不是睡眠/待机模式
推荐答案
当您关闭设备时,通知将变为不存在,因此当您重新打开设备时,什么都不会在没有再次创建通知的情况下发生。
When you turn off your device, the notification becomes non-existant, so when you turn your device back on, nothing is going to happen without creating that notification again.
因此,如果您安排3PM的活动,并且您的设备在下午2:59关闭,那么请在下午3:59返回通知不会触发,因为它必须重新创建。
So if you schedule an event for 3PM and your device is turned off at 2:59PM, then back on at 3:59PM, the notification will not fire because it has to be recreated.
这篇关于iPhone关闭时的UILocalNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!