Skip to main content

cidre/un/
notification_request.rs

1use crate::{arc, define_cls, define_obj_type, ns, objc, un};
2
3define_obj_type!(
4    #[doc(alias = "UNNotificationRequest")]
5    pub NotificationRequest(ns::Id)
6);
7
8impl NotificationRequest {
9    define_cls!(UN_NOTIFICATION_REQUEST);
10
11    #[objc::msg_send(identifier)]
12    pub fn id(&self) -> arc::R<ns::String>;
13
14    #[objc::msg_send(content)]
15    pub fn content(&self) -> arc::R<un::NotificationContent>;
16
17    #[objc::msg_send(requestWithIdentifier:content:trigger:)]
18    pub fn with_trigger(
19        id: &ns::String,
20        content: &un::NotificationContent,
21        trigger: Option<&un::NotificationTrigger>,
22    ) -> arc::R<Self>;
23}
24
25unsafe extern "C" {
26    static UN_NOTIFICATION_REQUEST: &'static objc::Class<NotificationRequest>;
27}