application(_:didReceiveRemoteNotification:fetchCompletionHandler:) not being invoked for silent pushes on iOS 11 beta 9

Originator:kamil.borzym
Number:rdar://34280205 Date Originated:September 6 2017, 5:31 PM
Status:Open Resolved:
Product:iOS + SDK / Notifications Product Version:iOS 11 beta 9 (15A5370a)
Classification:Serious Bug Reproducible:Always
 
Area:
Notifications

Summary:
`application(_:didReceiveRemoteNotification:fetchCompletionHandler:)` is not invoked for silent pushes (pushes without notification text, sound nor badge). Silent pushes works on latest iOS versions prior to iOS 11, also are well documented by Apple:
> “The payload’s aps dictionary must include the
> content-available key with a value of 1. The
> payload’s aps dictionary must not contain the
> alert, sound, or badge keys.” 
(https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1)
Absence of silent pushes will break backward iOS compatibility and badly affect lot of apps from the AppStore.

Steps to Reproduce:
1. Create an app, enable push notifications and background modes for remote notifications. Configure all certificates as described in Apple documentation. 
2. Implement `application(_:didReceiveRemoteNotification:fetchCompletionHandler:)`.
3. Send a push with following content:
{code}
{
    "aps" : {
        "content-available" : 1
    },
    "acme1" : "bar",
    "acme2" : 42
}
{code}

Expected Results:
`application(_:didReceiveRemoteNotification:fetchCompletionHandler:)` should be invoked as described in Apple documentation.

Actual Results:
`application(_:didReceiveRemoteNotification:fetchCompletionHandler:)` is being called on iOS 9 and iOS 10, but not on iOS 11 beta 9.
iOS 11 logs: 
{code}
default	17:24:58.254964 +0200	SpringBoard	Received incoming message on topic xx.xxx.xxxxxxx at priority 1
default	17:24:58.257488 +0200	SpringBoard	[xx.xxx.xxxxxxx] Received remote notification request 678F-AAA1 [ hasAlertContent: 0, hasSound: 0 hasBadge: 0 hasContentAvailable: 1 hasMutableContent: 0 ]
default	17:24:58.257680 +0200	SpringBoard	[xx.xxx.xxxxxxx] Deliver push notification request 678F-AAA1
default	17:24:58.257887 +0200	SpringBoard	[xx.xxx.xxxxxxx] Passing content-available push to Duet
default	17:24:58.258107 +0200	SpringBoard	SUBMITTING:  
error	17:24:58.258296 +0200	SpringBoard	Ignoring notification with no alert, sound or badge (xx.xxx.xxxxxxx): 678F-AAA1
default	17:24:58.258485 +0200	SpringBoard	[xx.xxx.xxxxxxx] Not saving push notification 678F-AAA1 to store [ error=Error Domain=UNErrorDomain Code=1401 "Notification has no user-facing content" UserInfo={NSLocalizedDescription=Notification has no user-facing content} ]
{code}

Version/Build:
iOS 11 beta 9 (15A5370a)

Configuration:
iPhone 7 Plus (MN4M2PM/A)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!