How do I check my applicationIconBadgeNumber value?

后端 未结 1 1379
情书的邮戳
情书的邮戳 2021-01-27 03:33

I want my redDot to display when I have some value in badge, i.e UIApplication.shared.applicationIconBadgeNumber this is the code I wrote, but doesnt s

相关标签:
1条回答
  • 2021-01-27 04:15

    Based on our conversation in chat about this, you have three things you need to happen:

    1. You set up a notification to fire later with a badge number. But the notification will not automatically set the badge number.
    2. You have to handle the notification when it fires, check the badge number value and update your app's badge number explicitly
    3. You check the app badge number in your other view and show/hide the red dot.

    I think you are doing #1 & #3 but not #2.

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