iOS Share Extension not returning items

Originator:davidmuzi
Number:rdar://30783075 Date Originated:01-Mar-2017
Status:Open Resolved:
Product:iOS Product Version:10.2
Classification:Bug Reproducible:Always
 
I have created an iOS Share Extension, and am returning a simple NSItemProvider:

    let item = NSItemProvider(item: "A Response" as NSSecureCoding, typeIdentifier: kUTTypeText as String)  
    let extensionItem = NSExtensionItem()  
    extensionItem.attachments = [item]  

    self.extensionContext!.completeRequest(returningItems: [extensionItem], completionHandler: nil)  
But in the host app, in the completionWithItemsHandler, completed is true, yet, returnedItems is nil.

    activityController.completionWithItemsHandler = { (activity, completed, items, error) in  

        print("\(items?.count)")  

    }  
Yet, returning the exact same response in an Action Extension, the result reached the host app.

Does a Share Extension not send its response back to the host app? The docs would suggest otherwise: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Share.html#//apple_ref/doc/uid/TP40014214-CH12-SW1

Sample project: https://www.dropbox.com/s/h3xg3wc5e1sp9sa/ExtensionApp.zip?dl=0

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!