Thank you for the confirmation of the extension target setup.
Here are more details to the problem part:
So, to get working cloud client solution we require 2 parts: extension(check) and app.
And in the app part we have to create the FP domain and in simplified form it may look like this (screenshot)
The domain creation doesn’t depend on UI, really, but it is unavailable for Catalyst, and this is the Problem.
The workaround solution we’ve found is next:
We’ve added a bundle in the app, and moved DomainManager there. Target platform set for this bundle is Mac.
But the app code(Catalyst) can’t link to the code(Mac) in this bundle and call it directly.
So we load bundle, instantiate principal class (DomainManager in runtime) as NSObject instance and call our NSObject category method on it, and the DomainManager’s version gets called.
class DomainManagerConnector {
func makeMacOSCodeAddDomain() {
if let bundleURL = Bundle.main.url(forResource: "NativeOnlyBundle", withExtension: "bundle"),
let myBundle = Bundle(url: bundleURL) {
if myBundle.load() { // Load the executable code
// Access the principal class of the bundle, if defined
if let principalClass = myBundle.principalClass as? NSObject.Type
{
let managerInstance = principalClass.init()
managerInstance.***_addDomain()
}
}
}
}
}
@objc public extension NSObject {
func ***_addDomain() {
}
}
I’m just not sure if such workaround will be stable and if it’s legit for the App Store distribution.