#[repr(C)]pub struct UNUserNotificationCenter {
pub ptr: Id<Object>,
}
Expand description
The central object for managing notification-related activities for your app or app extension.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl UNUserNotificationCenter
impl UNUserNotificationCenter
Sourcepub fn current_notification_center() -> UNUserNotificationCenter
pub fn current_notification_center() -> UNUserNotificationCenter
Returns your app’s notification center.
Sourcepub fn get_notification_settings_with_completion_handler<F>(
&self,
completion_handler: F,
)
pub fn get_notification_settings_with_completion_handler<F>( &self, completion_handler: F, )
Retrieves the authorization and feature-related settings for your app.
Sourcepub fn set_badge_count_with_completion_handler<F>(
&mut self,
new_badge_count: Int,
completion_handler: F,
)
pub fn set_badge_count_with_completion_handler<F>( &mut self, new_badge_count: Int, completion_handler: F, )
Updates the badge count for your app’s icon.
Requests the user’s authorization to allow local and remote notifications for your app.
Sourcepub fn set_delegate(&self, delegate: id)
pub fn set_delegate(&self, delegate: id)
Sourcepub fn supports_content_extensions(&self) -> bool
pub fn supports_content_extensions(&self) -> bool
A Boolean value that indicates whether the device supports notification content extensions.
Sourcepub fn add_notification_request_with_completion_handler<F>(
&mut self,
request: &UNNotificationRequest,
completion_handler: F,
)
pub fn add_notification_request_with_completion_handler<F>( &mut self, request: &UNNotificationRequest, completion_handler: F, )
Schedules the delivery of a local notification.
Sourcepub fn get_pending_notification_requests_with_completion_handler<F>(
&self,
completion_handler: F,
)
pub fn get_pending_notification_requests_with_completion_handler<F>( &self, completion_handler: F, )
Fetches all of your app’s local notifications that are pending delivery.
Sourcepub fn remove_pending_notification_requests_with_identifiers(
&mut self,
identifiers: &NSArray<NSString>,
)
pub fn remove_pending_notification_requests_with_identifiers( &mut self, identifiers: &NSArray<NSString>, )
Removes your app’s local notifications that are pending and match the specified identifiers.
Sourcepub fn remove_all_pending_notification_requests(&mut self)
pub fn remove_all_pending_notification_requests(&mut self)
Removes all of your app’s pending local notifications.
Sourcepub fn get_delivered_notifications_with_completion_handler<F>(
&self,
completion_handler: F,
)
pub fn get_delivered_notifications_with_completion_handler<F>( &self, completion_handler: F, )
Fetches all of your app’s delivered notifications that are still present in Notification Center.
Sourcepub fn remove_delivered_notifications_with_identifiers(
&mut self,
identifiers: &NSArray<NSString>,
)
pub fn remove_delivered_notifications_with_identifiers( &mut self, identifiers: &NSArray<NSString>, )
Removes your app’s notifications from Notification Center that match the specified identifiers.
Sourcepub fn remove_all_delivered_notifications(&mut self)
pub fn remove_all_delivered_notifications(&mut self)
Removes all of your app’s delivered notifications from Notification Center.
Sourcepub fn set_notification_categories(
&mut self,
categories: &NSSet<UNNotificationCategory>,
)
pub fn set_notification_categories( &mut self, categories: &NSSet<UNNotificationCategory>, )
Registers the notification categories that your app supports.
Sourcepub fn get_notification_categories_with_completion_handler<F>(
&self,
completion_handler: F,
)
pub fn get_notification_categories_with_completion_handler<F>( &self, completion_handler: F, )
Fetches your app’s registered notification categories.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.