iOS 推送角标解决方案

在App启动时:didFinishLaunchingWithOptions 方法中:application.applicationIconBadgeNumber = 0; //角标清零
在读消息时:
application.applicationIconBadgeNumber--

因为未读消息是后台存的,当拉取API后,得到未读消息数:

application.applicationIconBadgeNumber = 设置未读消息数
此文仅为鄙人学习笔记之用,朋友你来了,如有不明白或者建议又或者想给我指点一二,请私信我。liuw_flexi@163.com/QQ群:582039935. 我的gitHub: (学习代码都在gitHub) https://github.com/nwgdegitHub/
原文地址:https://www.cnblogs.com/liuw-flexi/p/11806368.html