Is there an entitlement for screen capture on macOS?

I have a macOS app that captures screen images. The first time I run this application, a dialog is shown directing the user to give my app Screen Recording permission. Is there a way I can trigger this dialog earlier and detect whether the permission was granted?

Answered by DTS Engineer in 840230022

Some updates…

george_austin_miller wrote:

Could Apple just update the developer documentation to show the correct availability (in this case macOS 11+) on the affected methods?

Yes we could. Given the limited options for updating 10.15.x, the best path forward here would be to update the availability macro in the SDK to indicate that it’s only available on macOS 11 and later.

Unfortunately our bug about this (r. 72786842) got a bit lost. If you’re suffering from this issue, I’d appreciate you filing a new bug and then posting your bug number here.

Oh, and I should also mention that, while these old school APIs continue to work, we recommend that you update your code to use ScreenCaptureKit.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there a way I can trigger this dialog earlier … ?

CGRequestScreenCaptureAccess

Is there a way I can … detect whether the permission was granted?

CGPreflightScreenCaptureAccess

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you!

our application crashes when running on Mojave 10.15

Indeed. This is a bug (r. 72786842). The functions were supposed to be available on 10.15.x but something went wrong with the way that was implemented. The workaround is to restrict your use of them to macOS 11 and later.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I also meet this bug. Please fix this bug in the next macOS Catalina release.

I do doubt there will be any change in 10.15.

Right. While it’s impossible to predict the future with 100% reliability, I’d be very surprised if this bug were fixed in a future 10.15.x update. In general we only update older OS releases to fix critical security issues, and that’s not the case here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Some updates…

george_austin_miller wrote:

Could Apple just update the developer documentation to show the correct availability (in this case macOS 11+) on the affected methods?

Yes we could. Given the limited options for updating 10.15.x, the best path forward here would be to update the availability macro in the SDK to indicate that it’s only available on macOS 11 and later.

Unfortunately our bug about this (r. 72786842) got a bit lost. If you’re suffering from this issue, I’d appreciate you filing a new bug and then posting your bug number here.

Oh, and I should also mention that, while these old school APIs continue to work, we recommend that you update your code to use ScreenCaptureKit.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there an entitlement for screen capture on macOS?
 
 
Q