Share Extension not returning items

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 ActionExtension, 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: http://gofile.me/2oQIB/s9zxCa58g

hi. I have the same problem ( Does anybody know how to fix it?

Share Extension not returning items
 
 
Q