Performance issue

What I'm trying to do.
I am trying to upload the macOS app to App Store.

Issue.
I got a reject due to performance issue.
This is the message I received.


Guideline 2.1 - Performance
We discovered one or more bugs in your app when reviewed on Mac running macOS 10.15.6.


Specifically, the app does not appear to be listed in the Accessibility page. 

They also sent me a screenshot for the issue.
From what I understand, it looks like they want the app to be listed in System Preferences > Security & Privacy > Privacy > Accessibility so they can just simply click the checkbox to enable accessibility for the app.

What I did.

(1) Find related documentation on Apple developer site.
I was not able to find any related sources to solve how to add the app in the list. There were documents for camera / mic access but not for accessibility.

(2) Added some code to show an alert to help user how to enable accessibility for the app.
  • Function that check if keyboard access is enabled.

Code Block
// Check keyboard accesibility permission.
func checkAccesibility() -> Bool {
let options: NSDictionary =[kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String : true]
let accessEnabled = AXIsProcessTrustedWithOptions(options)
if !accessEnabled {
print("Access Not Enabled")
return false
} else{
print("Able to access keyboard")
return true
}
}
  • Function that shows an alert if keyboard access is disabled.

Code Block
// Show an alert if accesibility is disabled.
func showPopUp() {
print("Show popup")
let alert = NSAlert()
alert.messageText = "\"Memorian.app\" whould like to control this computer using accessibility feature."
alert.informativeText = "Grant access to this application in Security & Privacy preference, located in System Preferences."
alert.alertStyle = .informational
alert.addButton(withTitle: "Deny")
alert.addButton(withTitle: "Open System Preferences")
alert.addButton(withTitle: "Learn more")
let ret = alert.runModal()
switch ret {
case .alertFirstButtonReturn:
print("Denied")
        case .alertSecondButtonReturn:
      openSystemPreferenceAccesibilityPrivacy()
        case .alertThirdButtonReturn:
            openUrl()
        default:
            print("Other:\(ret)")
}
}
   
  • Function that helps the user redirect to System Preference>Security & Privacy> Privacy page.

Code Block
// Redirect the user to System Preference > Security & Privacy > [Privacy] > Accessibility
func openSystemPreferenceAccesibilityPrivacy() {
print("Go to System Preferences")
let prefsURL = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility")!
NSWorkspace.shared.open(prefsURL)
}
  • If user clicks "Learn more" button, it will open up a page on browser to read more details about it.

Code Block
 // Redirect the user to Customer support page. Web page that shows how to allow accessibility.
func openUrl() {
let url = URL(string: "https://www.apple.com")!
if NSWorkspace.shared.open(url) {
print("Learn more page is launched.")
print("default browser was successfully opened")
}
}


(3) See if there are any settings I had to add to info.plist.
I searched all the Privacy - ** related ones but I did not see one that really related to accessibility permission.



I will appreciate if someone can help we how to add the app in the list.

Thank you,



Do you support Accessibility features ?

I looked at keys in info.plist.
Is this one missing ?

property list key CFBundleSpokenName
A replacement for the app name in text-to-speech operations.
Name: Accessibility Bundle Name


Performance issue
 
 
Q