URLSession.shared() doesn't call completion in Notification Service Extension

Originator:simonmitchell.dev
Number:rdar://26839213 Date Originated:16/06/2016
Status:Open Resolved:
Product:iOS SDK Product Version:10.0 (14A5261v)
Classification: Reproducible:Sometimes
 
Summary:
When using URLSession.shared() in the didRecieve(_ request: UNNotificationRequest, withContentHandler contentHandler:(UNNotificationContent) -> Void) method the completion block is not called which results in serviceExtensionTimeWillExpire being called

Steps to Reproduce:
1. Add a Notification Service extension to an existing project
2. Set up a URLSession.shared() object in the didRecieve(request:withContentHandler) method
3. Call dataTask(with:completionHandler)
4. Exhibit that the completion handler is never called 

Expected Results:
The completion handler should be called every single time a push is received


Actual Results:
The completion handler is called in roughly 1 in 20 push notifications received.


Version:
10.0 (14A5261v)

Notes:
Note that we use similar methods in a Today extension and the completion block is called without fail in those circumstances, however for the UNNotificationServiceExtension it is almost always never called.

Configuration:
iPod Touch 6th Generation

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!