objc2_push_kit/generated/PKPushCredentials.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 encapsulates the device token you use to deliver push notifications
11 /// to your app.
12 ///
13 /// When registering your app's push types, PushKit creates a ``PushKit/PKPushCredentials``
14 /// object for each type your app supports and delivers it to your delegate's ``PushKit/PKPushRegistryDelegate/pushRegistry:didUpdatePushCredentials:forType:``
15 /// method. Don't create ``PushKit/PKPushCredentials`` objects yourself.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/pushkit/pkpushcredentials?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct PKPushCredentials;
21);
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for PKPushCredentials {}
25);
26
27impl PKPushCredentials {
28 extern_methods!(
29 #[cfg(feature = "PKDefines")]
30 /// The push type constant associated with the token.
31 ///
32 /// For possible values, see ``PushKit/PKPushType``.
33 #[unsafe(method(type))]
34 #[unsafe(method_family = none)]
35 pub unsafe fn r#type(&self) -> Retained<PKPushType>;
36
37 /// A unique device token to use when sending push notifications to the current device.
38 ///
39 /// Forward this token to the server you use to generate push notifications. When preparing
40 /// to deliver a push notification to the current device, include the token in the HTTP
41 /// request you send to Apple Push Notification service (APNs).
42 #[unsafe(method(token))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn token(&self) -> Retained<NSData>;
45 );
46}
47
48/// Methods declared on superclass `NSObject`.
49impl PKPushCredentials {
50 extern_methods!(
51 #[unsafe(method(init))]
52 #[unsafe(method_family = init)]
53 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55 #[unsafe(method(new))]
56 #[unsafe(method_family = new)]
57 pub unsafe fn new() -> Retained<Self>;
58 );
59}