NSURLSessionConfiguration with a sharedContainerIdentifier I'm getting back a invalidated NSURLSession

Originator:ben
Number:rdar://18156592 Date Originated:8/27/2014
Status:Open Resolved:No
Product:iOS SDK Product Version:8.0 (12A4345d)
Classification:Serious Bug Reproducible:Always
 
Summary:
I've created an App Group in my provisioning profile for my app. I've also added Suite usage for my NSUserDefaults. I know the app group is working because the extension I'm testing can access the NSUserDefaults fine. However when I create a NSURLSessionConfiguration with a sharedContainerIdentifier I'm getting back a invalidated NSURLSession immediately which according to the documentation is what happens when the App Group is not valid or you don't set the  sharedContainerIdentifier properly.

Steps to Reproduce:
let sessionConfig = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("io.avocado.AvocadoShare.UploadSession")

sessionConfig.sharedContainerIdentifier = "group.avocado.io"

sessionConfig.allowsCellularAccess = true
sessionConfig.sessionSendsLaunchEvents = true
sessionConfig.discretionary = true
sessionConfig.HTTPShouldSetCookies = true

let session = NSURLSession(configuration: sessionConfig)

// This task is immediately invalidated
let task = session.uploadTaskWithRequest(aRequest, fromFile: fileUrl)

Expected Results:
A valid working session. This was working in Xcode6-B5 I believe, but it is no longer working. My code hasn't changed

Actual Results:
This task is immediately invalidated. See above sample code

Version:
8.0 (12A4345d)

Notes:
Occurs in Xcode6-B6, but same code was working in Xcode6-B5
https://devforums.apple.com/message/1030869#1030869

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!