4

How can I be notified whenever any application delivers or activates an NSUserNotification?

  • Neither could I determine anything that is sent via NSDistributedNotificationCenter,
  • nor could I find a mask like NSUserNotificationDeliveredMask [dummy name] I could register a global [NSEvent addGlobalMonitorForEventsMatchingMask] for,
  • nor does there seem to be a suitable observer for the default user notification center object.

The [NSUserNotificationCenter defaultCenter] and its delegate only notify me when my own app delivers a notification.

arik
  • 28,170
  • 36
  • 100
  • 156

2 Answers2

0

This answer should address how to receive available notifications from NSDistributedNotificationCenter. There doesn't seem to be any way to get all NSUsernotifications as far as I know, though.

Community
  • 1
  • 1
Seb Jachec
  • 3,003
  • 2
  • 30
  • 56
0

It is not possible. You can only listen to NSDistributedNotificationCenter for "global" notifications. The app developer has to broadcast to NSDistributedNotificationCenter for you to hook into it.

You can't hijack other applications Notifications. Most apps and all apps distributed through App Store is sandboxed. The very nature of this limits your ability to hook into them!

d00dle
  • 1,276
  • 1
  • 20
  • 33