How to identify the first desktop (space)?

My app observes NSWorkspaceActiveSpaceDidChangeNotification and set wallpaper on the active screen. But I see there is no way to distinguish between spaces on a screen. I'm not sure if I have read the docs thoroughly. I would like to know if it is possible to tell which space is active for the active screen.

There doesn't appear to be any public API to do this. Searching GitHub, there are some codes that do this, but they are using non-public API (e.g. using CGSCopyManagedDisplaySpaces)

How to identify the first desktop (space)?
 
 
Q