Event based UILocalNotification

时间:2016-04-05 21:04:43

标签: ios events notifications uilocalnotification schedule

I need to schedule a UILocalNotification when battery is n percent. UILocalNotification has fireDate property only and UIApplication class has below methods for presenting local notifications.

 - (void)presentLocalNotificationNow:(UILocalNotification *)notification;

- (void)scheduleLocalNotification:(UILocalNotification *)notification;

Is they are anything else that would help me post local notifications based on events and not time. I can do it when the app is in active or background state. But I want to schedule it, so even if app is terminated, it can post the notification.

1 个答案:

答案 0 :(得分:0)

不,您的应用需要运行才能安排本地通知。

为了做你想做的事情,你需要一些方法来在电池电量达到指定水平时启动你的应用,我不认为这是可能的。