We used Pushwhoosh for remote notification. Its working fine but Icon badge count not increased.
Here is code:
- (void) onPushReceived:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart
{
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge)];
PushNotificationManager * pushManager = [PushNotificationManager pushManager];
pushManager.delegate = self;
if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {
PushNotificationManager * pushManager = [PushNotificationManager pushManager];
[pushManager startLocationTracking];
}
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
}
How to increase app Icon badge count upon push delivery ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…