application:didReceiveRemoteNotification:fetchCompletionHandler not called on iOS 11

Hi,

I'm relying in the UIApplicationDelegate method "application:didReceiveRemoteNotification:fetchCompletionHandler" to receive some silent notifications when the application is not in the foreground.


With iOS 11 beta 1, this method is no longer called when I send this push payload


{
  "aps": {
    "content-available": 1
  },
  "mydata": {
    "foo": "bar"
  }
}



- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
}


Did anybody else noticed this behaviour?

Replies

I still see this issue with iOS 11 Beta 8. The notification is received if the app is in the foreground or being run via xcode.

I have the 'Remote notifications' background mode set in capabilities.

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1

Same for me. Still happening in iOS 11 beta 8.


The steps to reproduce I use now are the following:

  • In the Xcode project scheme, select "Wait for executable to be launched"
  • Add a breakpoint in the
    didReceiveRemoteNotification: fetchCompletionHandler
  • Start the app on device
  • Send the above silent push


Expected: The app is brought from suspended state to background and the

didReceiveRemoteNotification: fetchCompletionHandler
is called

Actual: nothing happens

Did anyone report this as a bug? Or is background mode not working any more in iOS 11. Any idea?

I am also able to reproduce this with iOS 11 Beta 8 and I filed a radar: http://openradar.appspot.com/34139840

I have.


33994653

Me too .. since iOS 11 beta 1 33002988

Thanks 🙂

Thanks 🙂

I would cautiously say it looks better in iOS 111 Beta 9 - first tests look promising

As far as I can tell, the same issue is still happening with iOS 11 beta 9.

I have had an issue (33511241) open since July 25 2017. It was marked as a duplicate of 15513528 which is still open.

Same problem with iOS beta 9. There is any oficial discusison about it?

well this is the official Apple Dev forum .. I also started a discussion on Stackoverflow https://stackoverflow.com/questions/44796613/silent-pushes-not-delivered-to-the-app-on-ios-11 I opened a bug at Apple (see above) but they seem to ignore it :/

Still not fixed in iOS 11 beta 10 :/ There was an update from Apple in the bug report:


Apple Developer Relations September 6 2017, 10:42 PM Engineering has provided the following feedback regarding this issue:
We were able to get the sample app running and test the behavior. We didn’t see any issues when we tested this as described.
Pushes aren't guaranteed to arrive to the app when it is running in the background, and the logs here indicate we don't believe the app is being used enough to launch it.
We do see us delivering pushes from time to time when conditions are good.
We believe this is behaving correctly.

That's what I mean, under Target > Capabilities > Background Modes. (Sorry, somehow I cannot attach a screenshot)

I do have this set and enabled correctly