-
Notifications
You must be signed in to change notification settings - Fork 0
/
PushKit.framework.h
209 lines (171 loc) · 7.96 KB
/
PushKit.framework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
// ========== PushKit.framework/Headers/PushKit.h
//
// PushKit.h
// PushKit
//
// Copyright (c) 2014 Apple. All rights reserved.
//
#import <PushKit/PKDefines.h>
#import <PushKit/PKPushCredentials.h>
#import <PushKit/PKPushPayload.h>
#import <PushKit/PKPushRegistry.h>
// ========== PushKit.framework/Headers/PKPushCredentials.h
//
// PKPushCredentials.h
// PushKit
//
// Copyright (c) 2014 Apple. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <PushKit/PKDefines.h>
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(10.15), uikitformac(13.0), ios(8.0), watchos(6.0), tvos(13.0))
@interface PKPushCredentials : NSObject
@property (readonly,copy) PKPushType type;
@property (readonly,copy) NSData *token;
@end
NS_ASSUME_NONNULL_END
// ========== PushKit.framework/Headers/PKDefines.h
//
// PKDefines.h
// PushKit
//
// Copyright (c) 2014 Apple. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifdef __cplusplus
#define PK_EXPORT extern "C" __attribute__((visibility("default")))
#else
#define PK_EXPORT extern __attribute__((visibility("default")))
#endif
typedef NSString *PKPushType NS_STRING_ENUM;
// ========== PushKit.framework/Headers/PKPushPayload.h
//
// PKPushPayload.h
// PushKit
//
// Copyright (c) 2014 Apple. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <PushKit/PKDefines.h>
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(10.15), uikitformac(13.0), ios(8.0), watchos(6.0), tvos(13.0))
@interface PKPushPayload : NSObject
@property (readonly,copy) PKPushType type;
@property (readonly,copy) NSDictionary *dictionaryPayload;
@end
NS_ASSUME_NONNULL_END
// ========== PushKit.framework/Headers/PKPushRegistry.h
//
// PKPushRegistry.h
// PushKit
//
// Copyright (c) 2014 Apple. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <PushKit/PKDefines.h>
NS_ASSUME_NONNULL_BEGIN
/* PKPushType constants can be used to register for a PKPushType-specific push token or to identify received push
notifications.
*/
PK_EXPORT PKPushType const PKPushTypeVoIP API_AVAILABLE(ios(9.0)) API_UNAVAILABLE(macos, uikitformac, watchos, tvos);
PK_EXPORT PKPushType const PKPushTypeComplication API_AVAILABLE(watchos(6.0)) API_DEPRECATED("Complication pushes are supported directly on watchOS now, so this should no longer be used on iOS.", ios(9.0, 13.0)) API_UNAVAILABLE(macos, uikitformac, tvos);
PK_EXPORT PKPushType const PKPushTypeFileProvider API_AVAILABLE(macos(10.15), ios(11.0), uikitformac(13.0)) API_UNAVAILABLE(watchos, tvos);
@protocol PKPushRegistryDelegate;
@class PKPushCredentials, PKPushPayload;
/*!
@class PKPushRegistry
@abstract An instance of this class can be used to register for 3rd party notifications. The supported push
notification types are listed above as PKPushType constants.
*/
API_AVAILABLE(macos(10.15), uikitformac(13.0), ios(8.0), watchos(6.0), tvos(13.0))
@interface PKPushRegistry : NSObject
/*!
@property delegate
@abstract Setting a delegate is required to receive device push tokens and incoming pushes.
*/
@property (readwrite,weak,nullable) id<PKPushRegistryDelegate> delegate;
/*!
@property desiredPushTypes
@abstract An app requests registration for various types of pushes by setting this NSSet to the desired
PKPushType constants. Push tokens and notifications will be delivered via delegate callback.
*/
@property (readwrite,copy,nullable) NSSet<PKPushType> *desiredPushTypes;
/*!
@method pushTokenForType:
@abstract Access the locally cached push token for a specified PKPushType.
@discussion A push token returned here has previously been given to the delegate via handlePushTokenUpdate:forType:
callback.
@param type
This is a PKPushType constant that is already in desiredPushTypes.
@result Returns the push token that can be used to send pushes to the device for the specified PKPushType.
Returns nil if no push token is available for this PKPushType at the time of invocation.
*/
- (nullable NSData *)pushTokenForType:(PKPushType)type;
/*!
@method initWithQueue:
@abstract Instantiates a PKPushRegistry with a delegate callback dispatch queue.
@param queue
All delegate callbacks are performed asynchronously by PKPushRegistry on this queue.
@result A PKPushRegistry instance that can be used to register for push tokens and notifications for supported
push types.
*/
- (instancetype)initWithQueue:(nullable dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
/*!
@method init
@abstract Unavailable, use -initWithQueue: instead.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
@protocol PKPushRegistryDelegate <NSObject>
@required
/*!
@method pushRegistry:didUpdatePushCredentials:forType:
@abstract This method is invoked when new credentials (including push token) have been received for the specified
PKPushType.
@param registry
The PKPushRegistry instance responsible for the delegate callback.
@param pushCredentials
The push credentials that can be used to send pushes to the device for the specified PKPushType.
@param type
This is a PKPushType constant which is present in [registry desiredPushTypes].
*/
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)pushCredentials forType:(PKPushType)type;
@optional
/*!
@method pushRegistry:didReceiveIncomingPushWithPayload:forType:
@abstract This method is invoked when a push notification has been received for the specified PKPushType.
@param registry
The PKPushRegistry instance responsible for the delegate callback.
@param payload
The push payload sent by a developer via APNS server API.
@param type
This is a PKPushType constant which is present in [registry desiredPushTypes].
*/
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type API_DEPRECATED_WITH_REPLACEMENT("-pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void(^)(void))completion", ios(8.0, 11.0)) API_UNAVAILABLE(macos, watchos, tvos);
/*!
@method pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:
@abstract This method is invoked when a push notification has been received for the specified PKPushType.
@param registry
The PKPushRegistry instance responsible for the delegate callback.
@param payload
The push payload sent by a developer via APNS server API.
@param type
This is a PKPushType constant which is present in [registry desiredPushTypes].
@param completion
This completion handler should be called to signify the completion of payload processing.
*/
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void(^)(void))completion API_AVAILABLE(macos(10.15), uikitformac(13.0), ios(11.0), watchos(6.0), tvos(13.0));
/*!
@method pushRegistry:didInvalidatePushTokenForType:
@abstract This method is invoked if a previously provided push token is no longer valid for use. No action is
necessary to rerequest registration. This feedback can be used to update an app's server to no longer
send push notifications of the specified type to this device.
@param registry
The PKPushRegistry instance responsible for the delegate callback.
@param type
This is a PKPushType constant which is present in [registry desiredPushTypes].
*/
- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(PKPushType)type;
@end
NS_ASSUME_NONNULL_END