jpush-react-native icon indicating copy to clipboard operation
jpush-react-native copied to clipboard

ios中logo的角标没办法清除,安卓中logo没有角标

Open lhh-sofy opened this issue 7 years ago • 14 comments

  • 插件版本:2.2.13
  • react-native 版本:0.57.3

你好,我在componentWillUnmount方法中使用了demo中的方法 //清除所有推送通知 JPushModule.clearLocalNotifications(); JPushModule.clearAllNotifications(); JPushModule.removeReceiveCustomMsgListener(this.receiveCustomMsgListener) JPushModule.removeReceiveNotificationListener(this.receiveNotificationListener) JPushModule.removeReceiveOpenNotificationListener(this.openNotificationListener)

目前情况是 ios中的logo数量角标没办法清除,安卓中是logo没有角标数字

lhh-sofy avatar Nov 13 '18 02:11 lhh-sofy

确定 componentWillUnmount 执行了吗?

huangminlinux avatar Nov 13 '18 02:11 huangminlinux

我应用都关闭了,应该是执行了啊

lhh-sofy avatar Nov 13 '18 02:11 lhh-sofy

@lhh-sofy 试试这个:

if (state === 'active') { JPushModule.clearAllNotifications() }

winterwd avatar Nov 13 '18 06:11 winterwd

Android角标需要自己定制,可以参照社区总结

JoshLipan avatar Nov 13 '18 09:11 JoshLipan

@lhh-sofy 试试这个:

if (state === 'active') { JPushModule.clearAllNotifications() }

你看我发的问题,这个也是不能使用的,都清除不了

lhh-sofy avatar Nov 14 '18 02:11 lhh-sofy

使用JPushModule.setBadge(0, success => {}) 照样清除不了ios中的logo角标,希望你们可以排查一下。。。。非常感谢》。

lhh-sofy avatar Nov 14 '18 07:11 lhh-sofy

有没有先调用 initPush 这个方法?

huangminlinux avatar Nov 19 '18 03:11 huangminlinux

initPush这个是安卓的方法,调用了。。

lhh-sofy avatar Nov 19 '18 03:11 lhh-sofy

iOS 偶现无法清除,调用方法

JPushModule.setBadge(0, success => {})
"jpush-react-native": "^2.5.0",

xwartz avatar Feb 12 '19 06:02 xwartz

JPushModule.setBadge(ret.MyCount, success => {
                JPushModule.getBadge(badge => {
                console.log('JPushModuleGetBadge', badge);
         });
 });```
自己服务器维护了一个消息数量,我在页面中调用setBadge和getBadge都成功的回调了,但是app应用并没有出现角标。
我知道了,刚才用的模拟器测试,真机是可以实现的

inkCrazy avatar Jul 31 '19 08:07 inkCrazy

ios: 13.1

componentDidMount() {
        JPush.init();
        JPush.setBadge({ badge: 0 });
      ...
}

ios角標無法清除

llitfkitfk avatar Oct 09 '19 06:10 llitfkitfk

请问你们怎么解决的 我也有这个问题,望指教

dltjiangfeipeng avatar Oct 25 '19 10:10 dltjiangfeipeng

JPush.setBadge({ badge: 0 })失效

DaiYz avatar Nov 04 '19 03:11 DaiYz

有人解决吗?

tanhao8 avatar Mar 30 '20 01:03 tanhao8