Search code examples
androidiosfile-permissionssandbox

iOS equivalent to Android MODE_WORLD_READABLE


As the title says - is there something in iOS that lets you say 'this file is allowed to be accessed by other apps' - preferably only readable, but read/write would be good enough.

Basically I am trying to place a file outside the sandbox so other apps can read it - preferably via the openURL that points to a local file rather than an http address.

Thanks

Edit: I just received an answer from Apple Tech support and they told me that this is currently impossible (just after iOS 6 released)


Solution

  • I don't think it's possible to do it the way you describe. Last I checked, apps can only write inside their sandbox dir and cannot read inside other apps' sandboxes (though IIRC there used to be a few other writable directories).

    What, exactly, is the end result you are trying to achieve?

    If you know the app you want to read the data, you can use a custom URL scheme.

    If you have a file of a certain type (extension/content-type, I think), you can use UIDocumentInteractionController to let the user pick an app to open it in.

    If you just want to share some data with any app, the closest I can think of is a custom UIPasteboard. OpenUDID does this for a slightly dubious purpose.