El impulso silencioso rápido de iOS11 (búsqueda de fondo, didReceiveRemoteNotification) ya no funciona

Esperaba que el lanzamiento de iOS11 solucione el problema de inserción silenciosa, que estaba en las últimas versiones beta y iOS de GM.

Actualmente me cuesta entender por qué no recibo ningún mensaje push silencioso, que en realidad debería activar mi aplicación para realizar algunas tareas necesarias en segundo plano.

En iOS 10, solo uso la capacidad de búsqueda en segundo plano e implementé el 'código de activación' en mi AppDelegate como el código a continuación.

En iOS 11, el código de registro todavía funciona bien y mi backend también entrega la notificación push a los servidores DEV de Apple (sandbox) y también a los servidores PROD (versión de producción). Lamentablemente la funciónfunc application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) nunca se llama por las notificaciones push silenciosas.

¿Realmente extrañé algo aquí para iOS 11?

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  // .. some variables here ...

   func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

       // register silent push notification in backend
       application.registerForRemoteNotifications()

       // ... some code here ... 


       // Set Background Fetch Intervall for background services / terminated app
       UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)

       // ... some code here ... 

       return true
   }

   func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
       let tokenParts = deviceToken.map { data -> String in
           return String(format: "%02.2hhx", data)
       }
       let token = tokenParts.joined()
       logger.log.debug("Device Token: \(token)")

       let realm = RealmController()
       let user = realm.getLoggedInUserObject()

       // Send push token to server
       if let user = user {
           let email = user.email!

           let serverController = ServerController.serverController
           serverController.sendPushToken(token: token, email: email) { status in
               if status == 201 {
                // ... some code here ...
               } else {
               // ... some code here ...
               }
           }
       }
   }
   func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
       logger.log.debug(error)
   }
   func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
       logger.log.debug(userInfo)

       let aps = userInfo["aps"] as! [String: AnyObject]
       if aps["content-available"] as? Int == 1 {
          // .... some silent push tasks here ....
       }
   }
}

Respuestas a la pregunta(2)

Su respuesta a la pregunta