A way to access ~/Library/Messages for a sandboxed app ?

Hi,


I'm working on an app which purpose is to browse and search through Messages.app history in a better way than Messages.app allows you to. As of now, the app isn't sandboxed, and accesses ~/Library/Messages/ directly. This location is obviously disallowed for sandboxed apps, but I was hoping that an app could still access it if the user explicitely allows it to, through the NSOpenPanel (ie open that directory). However it doesn't seem to be the case. Does anyone have a suggestion on how I could do this ?


Thanks

You could request a temporary exception entitlement to provide read-only access to that directory. However, your app might be rejected anyway. Have a look at these regulations:


Guideline 2.29: Apps that do not use the appropriate Mac OS X APIs for modifying user data stored by other Apps (e.g bookmarks, Address Book or Calendar entries) will be rejected

6.2: Apps that look similar to Apple Products or Apps bundled on the Mac, including the Finder, iChat, iTunes, and Dashboard, will be rejected

These are from the Mac App Store Review Guidelines: https://developer.apple.com/app-store/review/guidelines/mac/

Of course, the ideal solution would be to use a supported framework for accessing the information. I found this in the documentation, and while it may be a little out of date, hopefully it will point you in the right direction: https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/InstantMessageProgGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004928-SW1

Thanks, but from what I read in the docs, that temporary exception is supposed to be obtained through user selection (ie NSOpenPanel) and I can't seem to get that working here.


As for the regulation you quote, it says "modifying data" - I'm only reading it. The Instant Message guide you link to dates back from the old iChat app and doesn't provide any facilities to access chat history, so I'm afraid it's not relevant to my app.

There's a nifty example of achieving this using XPC and secure bookmarks on GitHub.


https://github.com/baz/XPC-File-Access


If I remember right, it was all appropriately sandboxed.

Thank you, I'll take a look.


However, since my app requires access to the discussions' attachments (that is, all files under the Attachments/ folder), I don't think sandboxing is feasible, so I've decided to give up on that feature.

A way to access ~/Library/Messages for a sandboxed app ?
 
 
Q