Platforms to show: All Mac Windows Linux Cross-Platform

Back to UNUserNotificationCenterMBS class.

UNUserNotificationCenterMBS.addNotificationRequest(request as UNNotificationRequestMBS, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedules a local notification for delivery.

This method schedules local notifications only; you cannot use it to schedule the delivery of remote notifications. Upon calling this method, the system begins tracking the trigger conditions associated with your request. When the trigger condition is met, the system delivers your notification. If the request does not contain a UNNotificationTriggerMBS object, the notification is delivered right away.
You may call this method from any thread of your app.

request: The request object containing the notification payload and trigger information. This parameter must not be nil.

Calls addNotificationRequestCompleted event later. Request and tag parameter is passed through.

Some examples using this method:

UNUserNotificationCenterMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the shared user notification center object for your app or app extension.

UNUserNotificationCenterMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The destructor.

UNUserNotificationCenterMBS.getDeliveredNotifications(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a list of the app’s notifications that are still displayed in Notification Center.

This method executes asynchronously, returning immediately and executing the provided block on a background thread when the results become available.

Calls getDeliveredNotificationsCompleted event later. Tag parameter is

UNUserNotificationCenterMBS.getNotificationCategories(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Retrieves the app’s currently registered notification categories.

Use this method to retrieve your app’s currently registered notification types. You might use this method when you want to augment the current set of categories with new categories later on. Simply merge the returned set with any new category objects and register the updated set.

Calls getNotificationCategoriesCompleted event later. Tag parameter is passed through.

UNUserNotificationCenterMBS.getNotificationSettings(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Requests the notification settings for this app.

Use this method to determine the user interactions and notification-related features that your app is authorized to use. You might then use this information to enable or disable specific notification-related features of your app.
When the user initially grants authorization to your app, the system gives your app a set of default notification-related settings. The user may change those settings at any time to enable or disable specific capabilities. For example, the user might disable the playing of sounds when a notification arrives.

Calls getNotificationSettingsCompleted event later. Tag parameter is passed through.

UNUserNotificationCenterMBS.getPendingNotificationRequests(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a list of all notification requests that are scheduled and waiting to be delivered.

This method executes asynchronously, returning immediately and executing the provided block on a secondary thread when the results are available.

Calls getPendingNotificationRequestsCompleted event later. Tag parameter is passed through.

UNUserNotificationCenterMBS.removeAllDeliveredNotifications

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes all of the app’s delivered notifications from Notification Center.

Use this method to remove all of your app’s delivered notifications from Notification Center. The method executes asynchronously, returning immediately and removing the identifiers on a background thread. This method does not affect any notification requests that are scheduled, but have not yet been delivered.

UNUserNotificationCenterMBS.removeAllPendingNotificationRequests

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Unschedules all pending notification requests.

This method executes asynchronously, removing all pending notification requests on a secondary thread.

UNUserNotificationCenterMBS.removeDeliveredNotifications(identifiers() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes the specified notification requests from Notification Center.

identifiers: An array of strings, each of which corresponds to a value in the identifier property of a UNNotificationRequestMBS object. This method ignores the identifiers of requests whose notifications are not currently displayed in Notification Center.

Use this method to selectively remove notifications that you no longer want displayed in Notification Center. The method executes asynchronously, returning immediately and removing the specified notifications on a background thread.

UNUserNotificationCenterMBS.removePendingNotificationRequests(identifiers() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Unschedules the specified notification requests.

identifiers: An array of strings, each of which contains the identifier of an active UNNotificationRequestMBS object. If the identifier belongs to a non repeating request, and the trigger condition for that request has already been met, this method ignores the identifier.

This method executes asynchronously, removing the pending notification requests on a secondary thread.

UNUserNotificationCenterMBS.requestAuthorization(options as integer, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Requests authorization to interact with the user when local and remote notifications are delivered to the user's device.

options: The authorization options your app is requesting. You may combine the available constants to request authorization for multiple items. Request only the authorization options that you plan to use. For a list of possible values, see UNAuthorizationOptions.

Calls requestAuthorizationCompleted event later. The tag parameter is passed through.

If your app's local or remote notifications involve user interactions, you must request authorization for the system to perfom those interactions on your app's behalf. Interactions include displaying an alert, playing a sound, or badging the app's icon.

Always call this method before scheduling any local notifications and before registering with the Apple Push Notification service. Typically, you call this method at launch time when configuring your app's notification support.

The first time your app ever calls the method, the system prompts the user to authorize the requested interactions. The user may grant or deny authorization, and the system stores the user’s response so that subsequent calls to this method do not prompt the user again. After determining the authorization status, the user notification center object executes the block in the completionHandler parameter. Use that block to make any adjustments to your app's behavior. For example, if authorization was denied, you might notify a remote notification server not to send notifications to the user’s device.

The user may change the allowed interactions at any time in system settings. Use the getNotificationSettings method to determine what interactions are currently allowed for your app.

UNUserNotificationCenterMBS.setNotificationCategories(categories() as UNNotificationCategoryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method User Notifications MBS MacFrameworks Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Registers your app’s notification types and the custom actions that they support.

categories: A set of UNNotificationCategoryMBS objects, each of which contains the actions that are displayed with the notification interface. This parameter must contain all of your app’s supported categories.

Call this method at launch time to register your app’s actionable notification types. This method registers all of your categories at once, replacing any previously registered categories with the new ones in the categories parameter. Typically, you call this method only once.

Each object in the categories parameter contains a string for identifying the notification's type. It also contains one or more custom actions that the user may perform in response to notifications of that type. When the system displays an alert for a notification, it looks in the notification payload for one of the identifier strings from your category objects. If it finds one, it adds user-selectable buttons for each action associated with that category object. Tapping a button notifies your app of the selected action, without bringing your app to the foreground.

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


The biggest plugin in space...