objc2-push-kit 0.3.2

Bindings to the PushKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// An object that contains information about a received PushKit notification.
    ///
    /// ## Topics
    ///
    /// ### Payload Data
    ///
    /// - ``PushKit/PKPushPayload/dictionaryPayload``
    /// - ``PushKit/PKPushPayload/type``
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/pushkit/pkpushpayload?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKPushPayload;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for PKPushPayload {}
);

impl PKPushPayload {
    extern_methods!(
        #[cfg(feature = "PKDefines")]
        /// The type value indicating how to interpret the payload.
        ///
        /// For possible values, see ``PushKit/PKPushType``.
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub unsafe fn r#type(&self) -> Retained<PKPushType>;

        /// The contents of the received payload.
        ///
        /// For VoIP pushes, the sender is free to specify any fields for the contained data
        /// as long as it is provided in a text-encodable JSON format.
        #[unsafe(method(dictionaryPayload))]
        #[unsafe(method_family = none)]
        pub unsafe fn dictionaryPayload(&self) -> Retained<NSDictionary>;
    );
}

/// Methods declared on superclass `NSObject`.
impl PKPushPayload {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}