Submit an app that add a ".dictionary" file to the build-in dictionary app

I am creating a Vietnamese dictionary app for Mac. I have ".dictionary" file created using the Apple Dictionary Development Kit and I want to add it to the Mac build-in dictionary app. It can easily be done if my app run in a non-sandboxed environment (by copying the .dictionary file to ~/Library/Dictionaries/).

However, I want to submit my app to the Mac App Store but I don't know how to add my .dictionary file to the build-in dictionary app in a sandboxed environment. I have tried to create a Temporary Exception Entitlement using this key: "com.apple.security.temporary-exception.files.home-relative-path.read-write" but still unable to copy the .dictonary file to "~/Library/Dictionaries/" folder due to a permission error.


So my question is: Is it possible for me to add my .dictionary file to the Mac build-in dictionary app in a SANDBOXED environment? If it is possible, will my app get approved on the Mac App Store?

Accepted Reply

Is it possible for me to add my

.dictionary
file to the Mac build-in dictionary app in a … Mac App Store app?

Not directly. The temporarily entitlement should work technically, but it’s likely to run into App Review problems.

The approach I’d recommend is to use a save panel. When the user asks to install your dictionary, put up a save panel for them to select the install location. That save panel will extend your app’s sandbox to give it write access to the relevant path, and then it can save your dictionary there.

To make things easier for the user you can set the initial location for the save panel to

~/Library/Dictionaries/
(via the
directoryURL
property) and set the default name (via the
nameFieldStringValue
property).

Finally, I must emphasise that I don’t work for App Review and can’t guarantee that they’ll accept this approach. The above will work at a technical level, but App Review may find other things they don’t like about it.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

Is it possible for me to add my

.dictionary
file to the Mac build-in dictionary app in a … Mac App Store app?

Not directly. The temporarily entitlement should work technically, but it’s likely to run into App Review problems.

The approach I’d recommend is to use a save panel. When the user asks to install your dictionary, put up a save panel for them to select the install location. That save panel will extend your app’s sandbox to give it write access to the relevant path, and then it can save your dictionary there.

To make things easier for the user you can set the initial location for the save panel to

~/Library/Dictionaries/
(via the
directoryURL
property) and set the default name (via the
nameFieldStringValue
property).

Finally, I must emphasise that I don’t work for App Review and can’t guarantee that they’ll accept this approach. The above will work at a technical level, but App Review may find other things they don’t like about it.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"