1 问题
移动推送Android SDK:推送的角标自增需要特殊设置吗?
2 解决方案
移动推送Android一般情况下,角标不需要特殊设置,但是由于Android本身就没有统一的设置角标的接口,再加上很多品牌手机并不支持设置角标。如果有设置角标需求,可以在推送接收的onNotification方法中里面自行设置。
- [backcolor=transparent]public[backcolor=transparent] [backcolor=transparent]class[backcolor=transparent] [backcolor=transparent]MyMessageReceiver[backcolor=transparent] [backcolor=transparent]extends[backcolor=transparent] [backcolor=transparent]MessageReceiver[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]...
- [backcolor=transparent] [backcolor=transparent]@Override
- [backcolor=transparent] [backcolor=transparent]public[backcolor=transparent] [backcolor=transparent]void[backcolor=transparent] onNotification[backcolor=transparent]([backcolor=transparent]Context[backcolor=transparent] context[backcolor=transparent],[backcolor=transparent] [backcolor=transparent]String[backcolor=transparent] title[backcolor=transparent],[backcolor=transparent] [backcolor=transparent]String[backcolor=transparent] summary[backcolor=transparent],[backcolor=transparent] [backcolor=transparent]Map[backcolor=transparent]<[backcolor=transparent]String[backcolor=transparent],[backcolor=transparent] [backcolor=transparent]String[backcolor=transparent]>[backcolor=transparent] extraMap[backcolor=transparent])[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]// TODO 处理角标逻辑
- [backcolor=transparent] [backcolor=transparent]...
- [backcolor=transparent] [backcolor=transparent]}