Can I change the message in a repeating UILocalNotification?
Asked Answered
B

1

6

I have a UILocalNotification that repeats every hour and I would like to change the message when it repeats so it is different, or rotates between 3 messages.

Does anyone know of a way to do this?

Also, it appears I cannot customize my repeating local notifications beyond once every minute, hour, day, etc. What I'd like is a notification every 15 minutes. I suspect that can't be done though... unless you know a way?

Many thanks for assistance you can offer.

Bloodmobile answered 29/4, 2012 at 22:22 Comment(0)
E
5

If you wanna change the message you can acces to the scheduledLocalNotifications array in your app delegate and modify the message, but to do that you need the app to be running. I think it's better to simply schedule different notifications with the different messages you want to show.

About the repeating interval the simple answers is no, you can't create your own repeating intervals. This is one of the many limitations that UILocalNotificationhas. Many apps (included mine) had solve the problem creating a queue of notifications. I explain that topic here

Exanthema answered 29/4, 2012 at 22:31 Comment(3)
Thanks for the answer, man. Not exactly what I wanted to hear, but thanks for saving me more time and frustration in trying to find an answer. Will def check out your link now.Bloodmobile
I hope Apple hear us an provide us more ways to personalize the notifications, because scheduling complex notifications becomes a mess with this limitations.Exanthema
I think this answer should be updated, because in the meantime there are options for repeating LocalNotifications to edit the current pending / replace the current pending by identifier. techotopia.com/index.php/…Charmaincharmaine

© 2022 - 2024 — McMap. All rights reserved.