I have a sandboxed app that I'd like to submit to the app store.
One of the features of the app is that it's "networkable" - it will find other instances of itself on the local network and communicate with them, if the preferences have been set up that way. It's very easy to turn on/off the "broadcaster" and "receiver" in my app - there's a simple checkbox in the app's preferences.
I expect that this feature will be particularly popular for IT departments in charge of public computers. They'll want to set up the computers with the app running and the broadcaster turned on.
But lets suppose they're at a public school with kids who enjoy screwing up the settings on the computer (lord knows they love making the dock tiny and hide on an odd side of the screen while setting on the background with a picture that shows a false dock - on and on, you get the point.)
THE POINT
I'd like to have a lock for my app's preferences, just like Apple has in system preferences. It looks like SFAuthorization perfectly provides this functionality, but is not allowable in a sandboxed app and, by extension, not allowable on the Mac App Store.
If someone knows of a better possibility than those I'm about to list, please share, but otherwise, which of the following would be the best for me to pursue to solve this issue:
1 - Request a new password when the lock is enabled, which must be presented to unlock the app. (Issues: How do you ensure that the person who clicks on the lock is someone who should be allowed to click on it and minimize the chances it's maliciously locked - and then can't be easily unlocked by someone who should be able to modify the settings.)
2 - Make a separate edition of my app, non-sandboxed and distributed by some other means, which just uses SFAuthorization. (Issues: How do I distribute it? How do I advertise it? Plus it'd be a pain to have to keep two editions of the app up to date...)
3 - Don't distribute through the app store, don't sandbox, just use SFAuthorization. (Issues: This would be even more difficult to advertise... I don't even know how I could distribute it.)
4 - Include in my app a link to where a preference panel can be downloaded. The preference panel can use SFAuthorization and modify my app's NSUserDefaults file so that my app knows the preferences normally accessible through it should be disabled. (Issues: Fairly complicated for me to make and my users to use... and how would I distribute this?)
Edit
Does anyone know anything about SMJobBless()? Apple has a sample project, but as far as I can tell, it doesn't actually work at all. I tried compiling and running it, but it appears to quit itself before doing anything? It doesn't post anything to the console, it doesn't add itself to the dock or menubar... as far as I can tell, it simply starts, Xcode says it's running fine, and then the app quits. Does the sample behave differently on anyone else's computer? Mine is running 10.7.4...
Is SMJobBless acceptable in a sandboxed app? It seems like there has to be some way of doing this, as now that I think about it, the MAS version of Xcode is sandboxed and needs authorization to install the command line tools.
2X Edit
Nevermind, just double checked and Xcode is not sandboxed T.T
3X Edit
I just checked... the Console app is actually where the output is placed (not in the Xcode output window.) "Hello World" is appearing as it should, along with the numbers... I'm not quite sure how to use this within my own app, though...
One of the features of the app is that it's "networkable" - it will find other instances of itself on the local network and communicate with them, if the preferences have been set up that way. It's very easy to turn on/off the "broadcaster" and "receiver" in my app - there's a simple checkbox in the app's preferences.
I expect that this feature will be particularly popular for IT departments in charge of public computers. They'll want to set up the computers with the app running and the broadcaster turned on.
But lets suppose they're at a public school with kids who enjoy screwing up the settings on the computer (lord knows they love making the dock tiny and hide on an odd side of the screen while setting on the background with a picture that shows a false dock - on and on, you get the point.)
THE POINT
I'd like to have a lock for my app's preferences, just like Apple has in system preferences. It looks like SFAuthorization perfectly provides this functionality, but is not allowable in a sandboxed app and, by extension, not allowable on the Mac App Store.
If someone knows of a better possibility than those I'm about to list, please share, but otherwise, which of the following would be the best for me to pursue to solve this issue:
1 - Request a new password when the lock is enabled, which must be presented to unlock the app. (Issues: How do you ensure that the person who clicks on the lock is someone who should be allowed to click on it and minimize the chances it's maliciously locked - and then can't be easily unlocked by someone who should be able to modify the settings.)
2 - Make a separate edition of my app, non-sandboxed and distributed by some other means, which just uses SFAuthorization. (Issues: How do I distribute it? How do I advertise it? Plus it'd be a pain to have to keep two editions of the app up to date...)
3 - Don't distribute through the app store, don't sandbox, just use SFAuthorization. (Issues: This would be even more difficult to advertise... I don't even know how I could distribute it.)
4 - Include in my app a link to where a preference panel can be downloaded. The preference panel can use SFAuthorization and modify my app's NSUserDefaults file so that my app knows the preferences normally accessible through it should be disabled. (Issues: Fairly complicated for me to make and my users to use... and how would I distribute this?)
Edit
Does anyone know anything about SMJobBless()? Apple has a sample project, but as far as I can tell, it doesn't actually work at all. I tried compiling and running it, but it appears to quit itself before doing anything? It doesn't post anything to the console, it doesn't add itself to the dock or menubar... as far as I can tell, it simply starts, Xcode says it's running fine, and then the app quits. Does the sample behave differently on anyone else's computer? Mine is running 10.7.4...
Is SMJobBless acceptable in a sandboxed app? It seems like there has to be some way of doing this, as now that I think about it, the MAS version of Xcode is sandboxed and needs authorization to install the command line tools.
2X Edit
Nevermind, just double checked and Xcode is not sandboxed T.T
3X Edit
I just checked... the Console app is actually where the output is placed (not in the Xcode output window.) "Hello World" is appearing as it should, along with the numbers... I'm not quite sure how to use this within my own app, though...
Last edited: