I have an app that works like a slideshow.
The app works on macOS Catalina, and it is sandboxed.
Now, I would like to provide a mode for running it in "kiosk mode".
Requirements:
It does provide kind of a kiosk mode, but my app does not receive any key events any more.
It does not matter whether I put this code in -awakeFromNib or in -applicationWillFinishLaunching or in -applicationDidFinishLaunching, I always get the "Funk" sound.
Of course, when I omit the above lines of code, everything works fine, i.e., I receive key events as usual.
I could switch to fullscreen just by calling
but then I don't have the kiosk mode precautions, like preventing the user from switching to other apps.
The second problem I am facing is this:
I would like to allow users to quit the app, provided they can authenticate themselves (requirement #4).
There used to be an API ( https://developer.apple.com/documentation/security/authorization_services ),
but it is not available in a sandboxed app. (I don't get Apple's reasoning, but oh well ...)
Question is: is there any way to achieve what I want?
The app works on macOS Catalina, and it is sandboxed.
Now, I would like to provide a mode for running it in "kiosk mode".
Requirements:
Run in fullscreen
Disallow app switching, quitting, etc.
Accept keyboard events
The currently logged in user should be able to gain full access by authenticating themselves.
Code Block objective-c NSApplicationPresentationOptions presentationOptions =(NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar | NSApplicationPresentationDisableAppleMenu | NSApplicationPresentationDisableProcessSwitching | NSApplicationPresentationDisableForceQuit | NSApplicationPresentationDisableHideApplication ); NSDictionary *fullScreenOptions = @{ NSFullScreenModeApplicationPresentationOptions: @(presentationOptions) }; [self.window.contentView enterFullScreenMode: [NSScreen mainScreen] withOptions: fullScreenOptions ];
It does provide kind of a kiosk mode, but my app does not receive any key events any more.
It does not matter whether I put this code in -awakeFromNib or in -applicationWillFinishLaunching or in -applicationDidFinishLaunching, I always get the "Funk" sound.
Of course, when I omit the above lines of code, everything works fine, i.e., I receive key events as usual.
I could switch to fullscreen just by calling
Code Block [self.window toggleFullScreen: nil]
but then I don't have the kiosk mode precautions, like preventing the user from switching to other apps.
The second problem I am facing is this:
I would like to allow users to quit the app, provided they can authenticate themselves (requirement #4).
There used to be an API ( https://developer.apple.com/documentation/security/authorization_services ),
but it is not available in a sandboxed app. (I don't get Apple's reasoning, but oh well ...)
Question is: is there any way to achieve what I want?