In one of the apps I develop, I use a share extension to import Wallet passes (PKPass).
On iOS 13 (including the latest beta 8), when calling the share extension from within the iOS Mail app, the extension is not receiving the data in the expected format (URL).
This is the relevant snippet from the share extension’s ShareViewController:
if let inputItems = self.extensionContext?.inputItems,
let inputItem = inputItems.first as? NSExtensionItem,
let attachments = inputItem.attachments,
let attachment = attachments.first,
attachment.hasItemConformingToTypeIdentifier("com.apple.pkpass" as String){
attachment.loadItem(forTypeIdentifier: "com.apple.pkpass" as String, options: nil) { data, error in
print ("data: \(String(describing: data))")
}
On iOS 12 (latest version) this works fine also for an attachment in the iOS Mail app (in addition e.g. to a file in the Files app); data holds an optional URL. The print statement above shows as follows in the console:
data: Optional(file:///var/mobile/Library/Mail/8EF174CF-68B9-414E-A166-D04C9DBE020E/INBOX.imapmbox/Attachments/13846/2/Attachment-1.pkpass)
On iOS 13 (beta 8), in the iOS Mail app, data holds an optional _NSItemProviderSandboxedResource. The print statement above shows as follows in the console:
data: Optional(<_NSItemProviderSandboxedResource: 0x2839aa9e0>)
This seems to affect only the Mail app. In the Files app data holds - as expected - an URL.
Is this a bug (actually I have already reported this using Feedback Assistant back on beta 4) or some new security feature introduced by iOS 13? How can I access the attachment's url/data in this case?