Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have the iOS app on Swift (UIKit). Let's say I have the next array: ["a","b","c","d","e","f","g","j","h","k"]

I would like to:

  • fire notification every 1 hour,
  • notification should take a random letter from array and fire it as a text inside notification.

While implementing that I came across with the next issues:

  • local notifications fire well (every one hour), but I can't change inner text dynamically;
  • push notifications (that use CloudKit database) are able to throw only if there is one of events: add/edit/delete record in CloudKit database.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

A local notification cannot run any code when it fires. It has a fixed payload and that is what displays. The notification does not pass thru your app after you schedule it; the system does the firing and displaying for you. So a local notification is probably not what you are looking for here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...