简体   繁体   中英

Swift: Multiple local notifications but only show latest

I wanted to show a local notification at certain times of the day, and I should only be able to see (one) the latest notification in the notification center,

however my problem is:

(1) If i have set the local notifications to different identifiers, I get multiple notifications (which is expected, but not what I want)

(2) If i have one identifier and set it to all times, i get notified only on the last trigger time that i set, cause the other schedules were overridden

So, is it possible to get notified at specific times, and at the same time be able to see only the latest notification?

Thanks

I don't think it is possible. Unique identifier is useful if you want to modify or delete specific notification at a later time. If you use the same identifier, only the latest scheduled notification will fire.

If you could do multiple notifications and only show the latest one, that could be abused to schedule multiple back-to-back notifications to schedule a long audio playback.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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