In this application that I'm trying to make, I use push notifications. This part works just fine. When I send a notification I also add a badge to the app icon. The problem is when I lunch the application it should disappear again, but it does not.
-(IBAction)Push{
NSMutableDictionary *data = [NSMutableDictionary dictionary];
[data setObject:@"Numfeud: Troels made a move!" forKey:@"alert"];
[data setObject:[NSNumber numberWithInt:1] forKey:@"badge"];
[data setObject:@"bar" forKey:@"foo"];
[PFPush sendPushDataToChannelInBackground:@"GameChannel2" withData:data];
}
In the application didFinishLaunchingWithOptions
I try to set badge to 0 in this way:
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
How can I clear the application icon badge?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…