By adding "Privacy - Document Folder Usage Description : String" in Info.plist, I am not seeing the message in User consent

In Catalina I have added "Privacy - Document Folder Usage Description" : "Catalina wants to access your Destkop folder" in Info.plist


Code trying to access Desktop folder :


do {

try FileManager.default.trashItem(at: NSURL(fileURLWithPath: "/Users/catalina/Desktop/Doc.docx") as URL, resultingItemURL: nil)

} catch let err as NSError {


print(err)

}


I see system generated user consent but my customised message is not being added

Replies

In Catalina I have added "Privacy - Document Folder Usage Description" : "Catalina wants to access your Destkop folder" in Info.plist

The file you are quoting ( "/Users/catalina/Desktop/Doc.docx") is on the Desktop, but your usage description is for the Documents folder. You should see the custom string if you use "Privacy - Desktop Folder Usage Description" instead.

Its a typo , I have added all Documents, Desktop and Downloads in Info.plist. Did you tested it before answering because even after adding relevant key its not working




Thanks

Yep, works fine for me.

For me its not working, no clue what i missed

Hm, are you building against an older SDK? Haven't tried, but as

NSDesktopFolderUsageDescription
is new in 10.15, it might just not be used for apps that have been built with an older SDK...