Get event when screen is capturing by other app

Hi I am newbie to Mac development and currently trying to get info whether a display is captured, I found such info in doc:

CGDisplayIsCaptured(_:)
.

https://developer.apple.com/documentation/coregraphics/1562061-cgdisplayiscaptured.

But this one is deprecated. How can I find out whether a display is captured in other way?
The goal is: The app should be visible only for user not for those, who see shared screen. So II need to blur the app on screen capture or send notification to user that screen is currently capturing, so I need to know which evend cold notidy me about that.