ios - Update badge of icon and get the message of notification when the icon is clicked -
Every time I try to update the icon's badge when push notification arrives and when I click on that icon Which I want is a message of notification
I tried to use a local notification in "ApplicationDidReceiveRemoteNotifications" for the badge:
UILocalNotification * setBadge = [[UILocalNotification alloc] init]; UIApplication * app = [UIApplication shared application]; SetBadge.timeZone = [NSTimeZone default timezone]; // When a notification set is set, update the app badge. IconBadgeNumber + = 1; SetBadge.fireDate = [Date of NSDT is not intermediate between current: 2]; [App Schedule Local Notification: Setbase];
and
[UIApplication ShareApp] .applicationIconBadgeNumber + = 1;
None of them work.
"Text">
This works fine in my project:
- (zero) Application FeedbackActive: (UIApplication *) application {// any work was stopped which (Or did not start), while the application was inactive if the application was previously in the background, optionally refresh the user interface. Self.isBackground = No; [[NSNotificationCenter defaultCenter] postNotificationName: AppChangeState object: @ (self.isBackground)]; [[NSNotificationCenter defaultCenter] Post Notification: [NSNotification NotificationWithName: DID_BECOME_ACTIVE Object: Null User Information: Zero]]; [UIApplication ShareApp] .applicationIconBadgeNumber = 0; }
Comments
Post a Comment