IOS SDK集成不多说,官网写的很详细。
运行程序,如果出现以下图片内容,就证明成功了

因为我们只测IOS客户端,所以只用去极光官网去推送测试就行了

然后我们就会发现角标问题!!!

不管我们发送几次通知,这个APP角标永远为1,而且点击启动程序,在退出,这个角标还是1,感觉永远去不掉!!!
1.角标始终为1:
去极光官网,在推送消息的时候,设置badge属性,改为+1,这样每次收到通知,角标会加1了。

2.角标始终去不掉
在程序AppDelegate这个方法里面添加以下代码

代码如下:
[UIApplicationsharedApplication].applicationIconBadgeNumber=0;
[JPUSHServicesetBadge:0];
即每次打开APP初始化角标
为什么写在这里呢?
因为APP在关闭状态会收到通知,但是最小化在后台也会收到通知,如果写在

这个方法里面,只有重新打开APP才会初始化角标。
但是
最小化收到通知在打开APP是不会初始化角标的。
网友评论