Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AXIsProcessTrustedWithOptions not prompting for permission

I'm trying to use the Accessibility API and have this code:

NSDictionary *options = @{(__bridge id) kAXTrustedCheckOptionPrompt : @YES}; BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef) options);

This always returns no, however it does not prompt the user for permission nor does it display the app's name in System Preferences > Security & Privacy. What do I need to test this? I could try and add the debug version manually into System Preferences but how do I know that this will work properly when released to the public? Is there any way to test this out? I am not seeing any prompt at all.

like image 802
strangetimes Avatar asked Oct 27 '15 22:10

strangetimes


1 Answers

From Apple Developer Forums:

It appears, in 10.13.3 at least, that applications which are using the app sandbox will not have the alert shown. If you turn of app sandbox in the project entitlements then the alert is shown. - haikuty

like image 199
CheapSteaks Avatar answered Oct 20 '22 11:10

CheapSteaks