How to clear push notification badge count in iOS?

前端 未结 5 2373
挽巷
挽巷 2020-12-14 00:09

I want to clear the push notification badge count once app is launched.Im not clear where to set the below code.Please give brief description about clearing the badge count.

5条回答
  •  渐次进展
    2020-12-14 00:22

    Well, the better way to do this is to make a function that subtract the badge number then make a UIButton to let the user to clear the badge. In the default mail application, if you read one email the badge will subtract one from the icon. You should never set it 0 at launch or resume, it is meaningless and make the app look crappy. Subtract it when the user interact with that event is the best way to do it. Make your app more professional, if you just reset it when the app launch who know what is the bedges mean, may as well not use it.

提交回复
热议问题