アプリケーションのフレームワークを使用するように切り替えたのでPushKit
、プッシュ受信時にアプリ バッジの変更はありません。
使用するために行った APNS 実装への変更PushKit
:
サーバー側では、APNS 証明書を VOIP プッシュ証明書に置き換えました。
クライアント側では、次を置き換えました:
registerForRemoteNotifications
とPKPushRegistry *pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()]; pushRegistry.delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];`
didRegisterForRemoteNotificationsWithDeviceToken
そしてdidFailToRegisterForRemoteNotificationsWithError
_didUpdatePushCredentials
didReceiveRemoteNotification
そしてdidReceiveRemoteNotification FetchComplitionHandler
_didReceiveIncomingPushWithPayload
その結果、didReceiveIncomingPushWithPayload
が呼び出され、ペイロード ディクショナリに有効なバッジ番号が表示されますが、残念ながらアプリ バッジは変更されません。