我面临推送通知应用程序徽章编号值更新的问题。
我正在这样做:
-(void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateActive) {
// do stuff when app is active
}else{
// do stuff when app is in background
[UIApplication sharedApplication].applicationIconBadgeNumber =
[UIApplication sharedApplication].applicationIconBadgeNumber+1;
/* to increment icon badge number */
}
}
但是,该图标始终将徽章编号显示为“1”,并且当有更多通知/一个通知接踵而至时,它不会增加。
任何建议都是可观的...