Questions tagged [nsdistributednotification]

The NSDistributedNotificationCenter class provides a way to send notifications to objects in other tasks.

The NSDistributedNotificationCenter class provides a way to send notifications to objects in other tasks. It takes NSNotification objects and broadcasts them to any objects in other tasks that have registered for the notification with their task’s default distributed notification center.

The NSDistributedNotificationCenter class implements a notification center that can distribute notifications asynchronously to tasks other than the one in which the notification was posted. An instance of this class are known as a distributed notification center.

Apple Docs

6 questions
12
votes
4 answers

How to detect switch between macOS default & dark mode using Swift 3

I want to change my status bar app icon when the user switches from default to dark mode and vice versa (using Swift 3). Here’s what i have so far: func applicationDidFinishLaunching(_ aNotification: Notification) { …
2
votes
1 answer

NSDistributedNotifications not distributed between instances of (same) app(s)

On 10.7.2 I have trouble getting standard NSDistributedNotifications to work out of the box. Even when brought back to just (Full XCode version at https://github.com/dirkx/Example-NSDistribtuedNotification-Failing) to something as simple as below I…
2
votes
1 answer

Minimized macOS application + distributedNotificationCenter (background mode on macOS)

I've implemented a macOS app + extension. The extension might send notifications to the app via DistributedNotificationCenter.default() and postNotificationName(_ name: ...). The questions is regarding to the app life cycle on macOS - what happens…
Witterquick
  • 6,048
  • 3
  • 26
  • 50
2
votes
1 answer

Distributed notification no longer working in Catalina

I transfer data between a safari extension app and MacOS app by using Distributed Notification Center. I use DistributedNotificationCenter.default().addObserver with a specific notification name and I post a notification from the MacOS App using…
enzo
  • 72
  • 1
  • 3
  • 26
0
votes
1 answer

Not receiving DistributedNotificationCenter in Swift Command Line Tool

I'm building a small app in node.js that uses execa to read print statements coming from a compiled Swift application. The idea is similar to Sindre Sorhus' (who else!?) do-not-disturb Although I'm no Swift-programmer, I put together a pretty…
0
votes
0 answers

NSDistributedNotification on macOS intermittently doesn't work

I am using NSDistributedNotifications as an IPC on macOS between two processes. Sometimes I see that the notification is sent but is not received and the desired operation is not executed. Sender Code: [[NSDistributedNotificationCenter…
ZestyZest
  • 911
  • 13
  • 27