Platforms to show: All Mac Windows Linux Cross-Platform

Back to NotificationCenterMBS class.

NotificationCenterMBS.Add(name as CFStringMBS, obj as CFObjectMBS, flags as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Notifications MBS MacCF Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Adds a new callback.

This function costs around 24 bytes of memory per call which are never released (needed for the callback between framework and RB).

Values for the flags:
CFNotificationSuspensionBehaviorDrop1The server will not queue any notifications with this name and object while the process/app is in the background.
CFNotificationSuspensionBehaviorCoalesce2The server will only queue the last notification of the specified name and object; earlier notifications are dropped.
CFNotificationSuspensionBehaviorHold3The server will hold all matching notifications until the queue has been filled (queue size determined by the server) at which point the server may flush queued notifications.
CFNotificationSuspensionBehaviorDeliverImmediately4The server will deliver notifications matching this registration whether or not the process is in the background. When a notification with this suspension behavior is matched, it has the effect of first flushing any queued notifications.

NotificationCenterMBS.close(name as CFStringMBS, obj as CFObjectMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Notifications MBS MacCF Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Closes the given callback.

NotificationCenterMBS.closeAll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Notifications MBS MacCF Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Closes all registered callbacks.

This is called by the destructor.

NotificationCenterMBS.Post(name as CFStringMBS, obj as CFObjectMBS, userinfo as CFDictionaryMBS, deliverImmediately as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Notifications MBS MacCF Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Posts a new notification.

Obj and userinfo may be nil.

See also:

NotificationCenterMBS.Post(name as CFStringMBS, obj as CFObjectMBS, userinfo as CFDictionaryMBS, options as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Notifications MBS MacCF Plugin 7.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Posts a new notification.
Example
dim n as new NotificationCenterMBS
n.Post(NewCFStringMBS("test"), nil, nil, n.kCFNotificationPostToAllSessions + n.kCFNotificationDeliverImmediately)

Obj and userinfo may be nil.
Requires Mac OS X 10.3.
For options you can use a combination with kCFNotificationDeliverImmediately=1 and kCFNotificationPostToAllSessions=2.

See also:

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...