Why only my last local notification function is getting called?

前端 未结 2 1456
囚心锁ツ
囚心锁ツ 2020-12-06 20:32

I\'m fairly new to swift and am trying to call multiple functions that request a local notification inside a UISwitch IBAction. I want to send a notification on a certain da

相关标签:
2条回答
  • 2020-12-06 20:52

    Just a little help

    You can just add UUID().uuidString for identifier.

    Kudos Honey

    0 讨论(0)
  • 2020-12-06 20:57

    I think you're on +iOS10 and you're using UserNotifications framework right?

    Very likely your identifiers have the same and each are UPDATING the previous notification.

    The reason identifier exists is to assist you with updated a previous notification that has the same identifier. For example you send a notification to update the score from 0-0 to 0-1. And instead of having 2 notifications on the screen you now have only one.

    Your fix is to use different identifiers for each.

    For more see this moment for the WWDC video

    UPDATE after your edit: just as I said...all your notifications have "Quarterly" as their identifier. Give them each a separate name.

    0 讨论(0)
提交回复
热议问题