objc2_push_kit/generated/PKPushPayload.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// An object that contains information about a received PushKit notification.
11 ///
12 /// ## Topics
13 ///
14 /// ### Payload Data
15 ///
16 /// - ``PushKit/PKPushPayload/dictionaryPayload``
17 /// - ``PushKit/PKPushPayload/type``
18 ///
19 /// See also [Apple's documentation](https://developer.apple.com/documentation/pushkit/pkpushpayload?language=objc)
20 #[unsafe(super(NSObject))]
21 #[derive(Debug, PartialEq, Eq, Hash)]
22 pub struct PKPushPayload;
23);
24
25extern_conformance!(
26 unsafe impl NSObjectProtocol for PKPushPayload {}
27);
28
29impl PKPushPayload {
30 extern_methods!(
31 #[cfg(feature = "PKDefines")]
32 /// The type value indicating how to interpret the payload.
33 ///
34 /// For possible values, see ``PushKit/PKPushType``.
35 #[unsafe(method(type))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn r#type(&self) -> Retained<PKPushType>;
38
39 /// The contents of the received payload.
40 ///
41 /// For VoIP pushes, the sender is free to specify any fields for the contained data
42 /// as long as it is provided in a text-encodable JSON format.
43 #[unsafe(method(dictionaryPayload))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn dictionaryPayload(&self) -> Retained<NSDictionary>;
46 );
47}
48
49/// Methods declared on superclass `NSObject`.
50impl PKPushPayload {
51 extern_methods!(
52 #[unsafe(method(init))]
53 #[unsafe(method_family = init)]
54 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
55
56 #[unsafe(method(new))]
57 #[unsafe(method_family = new)]
58 pub unsafe fn new() -> Retained<Self>;
59 );
60}