Sandbox - a Levure Helper for working with files in the macOS sandbox

Collaborate on tools, libraries, and applications beyond the IDE

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 888
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Sandbox - a Levure Helper for working with files in the macOS sandbox

Post by trevordevore » Tue Oct 09, 2018 5:29 am

Hi,

I've posted a new Levure helper on GitHub called "sandbox". It adds support for working with file references across multiple app sessions in the macOS sandbox. It requires LiveCode 9 as it uses the Foreign Function Interface (aka FFI) to wrap Objective-C APIs.

If you distribute your apps through the Mac App Store then it is required that you sandbox your application. When an application is sandboxed the user has to give you explicit permission to open any files that reside outside of your applications container. For example, a user can do this by selecting a file using the `answer file` dialog or dragging a file onto your application. Your application will then have permission to access that file for the rest of the app session.

The next time your application launches, however, your application will not have permission to open the files again unless you implement security-scoped bookmarks and security-scoped urls. The helper uses an LCS library wrapped around an LCB extension to try and hide the complexity.

To learn more visit the GitHub page:

https://github.com/trevordevore/levurehelper-sandbox

If you don't use Levure but are interested in the LCB FFI code here is a direct link to that file:

https://github.com/trevordevore/levureh ... andbox.lcb
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Post Reply

Return to “Community Projects”