iOS JPush 推送数累加问题


(金峰) #1

iOS 推送消息角标一直累加 IOS 10.0.2 ApplicationIconBadgeNumber已设置0[JPUSHService setBadge:0];
[JPUSHService resetBadge]; 均调用过


#2

请确认你的调用是成功的。


(金峰) #3

确定是已经调用了,

func jpushNotificationCenter(_ center: UNUserNotificationCenter!, didReceive response: UNNotificationResponse!, withCompletionHandler completionHandler: (() -> Void)!) {
        let userInfo = response.notification.request.content.userInfo
        if (response.notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self))!{
           JPUSHService.handleRemoteNotification(userInfo)
            if UIApplication.shared.applicationIconBadgeNumber != 0 {
               UIApplication.shared.applicationIconBadgeNumber = 0
            }
           JPUSHService.setBadge(0)
       }
    }

JPUSHService.setBadge(0) 也执行了


#4

关键在于执行了,有没有成功?有没有打印succeed badge为0,我用demo测试是OK的。


(金峰) #5

2017-03-06 11:14:27.072503 YSJLogistics[1114:360323] | JPUSH | I - [JPUSHBadgeNumberReport] set badge:0 succeed


#6

你这样测试一下:
推送一条消息,给我提供msgid
然后提供客户端的完整的日志,从init开始的