Since I switched to using PushKit
framework for application, there are no app badge changes on push received.
Changes to APNS implementation I've done to use PushKit
:
On server side, I replaced APNS certificates with VOIP push certificates.
On client side, I replaced:
registerForRemoteNotifications
with
PKPushRegistry *pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()];
pushRegistry.delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];`
didRegisterForRemoteNotificationsWithDeviceToken
and didFailToRegisterForRemoteNotificationsWithError
with didUpdatePushCredentials
didReceiveRemoteNotification
and didReceiveRemoteNotification FetchComplitionHandler
with didReceiveIncomingPushWithPayload
As a result, didReceiveIncomingPushWithPayload
gets called, and I see valid badge number in payload dictionary, but, unfortunately app badge doesn't change.
答案 0 :(得分:0)
In your method didReceiveRemoteNotification
, you should update the badge number yourself by setting it like this:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
[application setApplicationIconBadgeNumber:1];
}