shares image file url not accessible from inside an action extension

Number:rdar://29918507 Date Originated:2017-01-08
Status:Open Resolved:
Product:iOS Product Version:10.2
Classification:Crash/Hang/Data Loss Reproducible:Always
When using the to send a Photo to an Action Extension, the extension receives the image itself and a file URL. The file URL however is not accessible from inside the action extension and a message is logged in the device’s console: ‘kernel SandboxViolation: PDF Actions(14392) deny(1) file-read-metadata /private/var/mobile/Library/SMS/Attachments/bd/13/12A03E5C-C12B-4797-9007-52AC16F774AC/IMG_2021.JPG’

Steps to Reproduce:
- Install the sample project on an actual device / run the ImageSharing target on that device
- Go to the
- Tap an image from a conversation to view it in full size
- Tap the action button in the image
- Tap an ImageSharing action extension

Expected Results:
The image is shown in the appearing view controller from the action extension.

Actual Results:
An error is shown, telling you that the path of the chosen image can not be accessed.

- This issue only occurs on an actual device, as iOS Simulator Sandboxing restrictions do not apply to the images from the messages app.

I am aware of the fact that the also shared the image as data blob and that this data blob can be accessed without issues. However in our actual usecase we prefere a file url over any data blob as it can be copied withouth any size constraints and without performing memory-heavy operations. If the messages app is unable to provide the image in a path that can be accessed, it should simply not share a file URL at all.


Sample code

By michaelhochs at Jan. 8, 2017, 4:28 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!