Implementing CloudKit in macOS application

I have been working on a cross platform app, iOS/macOS. But when I implemented CloudKit in the project, the iOS app works perfectly, but the macOS app presents a warning, as seen in following image.

I added CloudKit and Background Push Notifications in iOS, and just CloudKit in macOS. Is there any other capability I need to add to macOS so that this warning does not show up?

This message isn't related to a capability. As it says, you must publish your changes on the main thread....

...try using (for example):

DispatchQueue.main.async {
    // your publishing code here...
}

Or for Combine:

.receive(on: DispatchQueue.main)
Implementing CloudKit in macOS application
 
 
Q