NSPasteboard Compatibility Issue in Camera Extension

I've encountered an issue while working on a macOS project involving Camera extension, specifically related to NSPasteboard. I want to use NSPasteboard for sending string type data from app to Camera Extension. Strangely, the exact same code that works flawlessly with NSPasteboard in a DAL plugin doesn't seem to work when implemented in a camera extension.

To clarify, I can access the exact same pasteboard using the identical code in the DAL plugin and in an App, but when attempting the same in the camera extension, it doesn't behave as expected. Below is the code snippet I'm using in the camera extension:

let pasteboardExtension = NSPasteboard(name: NSPasteboard.Name(rawValue: "com.example.myextension"))
if let items = pasteboardExtension.readObjects(forClasses: [NSString.self], options: nil) as? [String] {
    NSLog("Received items in extension: \(items)")
} else {
    NSLog("No items received in extension")
}

I've thoroughly reviewed the documentation without finding a resolution. Has anyone else faced a similar discrepancy between NSPasteboard behavior in DAL plugins and camera extensions? I'm reaching out for advice, insights, or potential workarounds from the community.

If you have successfully addressed a similar issue or have any information that might shed light on this situation, your input would be greatly appreciated.

Does Camera Extension support NSPasteBoard?

NSPasteboard Compatibility Issue in Camera Extension
 
 
Q