极光推送问题

2018-04-26  本文已影响0人  kled_net

如果遇到 badge 的值一直在累加那么久需要调用极光的方法去重置:

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
    [[UNUserNotificationCenter alloc] removeAllPendingNotificationRequests];
    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    [JPUSHService resetBadge];
}
上一篇下一篇

猜你喜欢

热点阅读