|
15 | 15 |
|
16 | 16 | @class PFQuery; |
17 | 17 |
|
| 18 | +PF_ASSUME_NONNULL_BEGIN |
| 19 | + |
18 | 20 | /*! |
19 | 21 | The `PFPush` class defines a push notification that can be sent from a client device. |
20 | 22 |
|
|
39 | 41 | @param channel The channel to set for this push. |
40 | 42 | The channel name must start with a letter and contain only letters, numbers, dashes, and underscores. |
41 | 43 | */ |
42 | | -- (void)setChannel:(NSString *)channel; |
| 44 | +- (void)setChannel:(PF_NULLABLE NSString *)channel; |
43 | 45 |
|
44 | 46 | /*! |
45 | 47 | @abstract Sets the array of channels on which this push notification will be sent. |
46 | 48 |
|
47 | 49 | @param channels The array of channels to set for this push. |
48 | 50 | Each channel name must start with a letter and contain only letters, numbers, dashes, and underscores. |
49 | 51 | */ |
50 | | -- (void)setChannels:(NSArray *)channels; |
| 52 | +- (void)setChannels:(PF_NULLABLE NSArray *)channels; |
51 | 53 |
|
52 | 54 | /*! |
53 | 55 | @abstract Sets an installation query to which this push notification will be sent. |
|
56 | 58 |
|
57 | 59 | @param query The installation query to set for this push. |
58 | 60 | */ |
59 | | -- (void)setQuery:(PFQuery *)query; |
| 61 | +- (void)setQuery:(PF_NULLABLE PFQuery *)query; |
60 | 62 |
|
61 | 63 | /*! |
62 | 64 | @abstract Sets an alert message for this push notification. |
|
65 | 67 |
|
66 | 68 | @param message The message to send in this push. |
67 | 69 | */ |
68 | | -- (void)setMessage:(NSString *)message; |
| 70 | +- (void)setMessage:(PF_NULLABLE NSString *)message; |
69 | 71 |
|
70 | 72 | /*! |
71 | 73 | @abstract Sets an arbitrary data payload for this push notification. |
|
76 | 78 |
|
77 | 79 | @param data The data to send in this push. |
78 | 80 | */ |
79 | | -- (void)setData:(NSDictionary *)data; |
| 81 | +- (void)setData:(PF_NULLABLE NSDictionary *)data; |
80 | 82 |
|
81 | 83 | /*! |
82 | 84 | @abstract Sets whether this push will go to Android devices. |
|
108 | 110 |
|
109 | 111 | @param date The time at which the notification should expire. |
110 | 112 | */ |
111 | | -- (void)expireAtDate:(NSDate *)date; |
| 113 | +- (void)expireAtDate:(PF_NULLABLE NSDate *)date; |
112 | 114 |
|
113 | 115 | /*! |
114 | 116 | @abstract Sets the time interval after which this notification should expire. |
|
169 | 171 | */ |
170 | 172 | + (void)sendPushMessageToChannelInBackground:(NSString *)channel |
171 | 173 | withMessage:(NSString *)message |
172 | | - block:(PFBooleanResultBlock)block; |
| 174 | + block:(PF_NULLABLE PFBooleanResultBlock)block; |
173 | 175 |
|
174 | 176 | /* |
175 | 177 | @abstract *Asynchronously* send a push message to a channel. |
|
185 | 187 | */ |
186 | 188 | + (void)sendPushMessageToChannelInBackground:(NSString *)channel |
187 | 189 | withMessage:(NSString *)message |
188 | | - target:(id)target |
189 | | - selector:(SEL)selector; |
| 190 | + target:(PF_NULLABLE_S id)target |
| 191 | + selector:(PF_NULLABLE_S SEL)selector; |
190 | 192 |
|
191 | 193 | /*! |
192 | 194 | @abstract Send a push message to a query. |
|
223 | 225 | */ |
224 | 226 | + (void)sendPushMessageToQueryInBackground:(PFQuery *)query |
225 | 227 | withMessage:(NSString *)message |
226 | | - block:(PFBooleanResultBlock)block; |
| 228 | + block:(PF_NULLABLE PFBooleanResultBlock)block; |
227 | 229 |
|
228 | 230 | /*! |
229 | 231 | @abstract *Synchronously* send this push message. |
|
246 | 248 | @param block The block to execute. |
247 | 249 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. |
248 | 250 | */ |
249 | | -- (void)sendPushInBackgroundWithBlock:(PFBooleanResultBlock)block; |
| 251 | +- (void)sendPushInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block; |
250 | 252 |
|
251 | 253 | /* |
252 | 254 | @abstract *Asynchronously* send this push message and calls the given callback. |
|
257 | 259 | `error` will be `nil` on success and set if there was an error. |
258 | 260 | `[result boolValue]` will tell you whether the call succeeded or not. |
259 | 261 | */ |
260 | | -- (void)sendPushInBackgroundWithTarget:(id)target selector:(SEL)selector; |
| 262 | +- (void)sendPushInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector; |
261 | 263 |
|
262 | 264 | /*! |
263 | 265 | @abstract *Synchronously* send a push message with arbitrary data to a channel. |
|
302 | 304 | */ |
303 | 305 | + (void)sendPushDataToChannelInBackground:(NSString *)channel |
304 | 306 | withData:(NSDictionary *)data |
305 | | - block:(PFBooleanResultBlock)block; |
| 307 | + block:(PF_NULLABLE PFBooleanResultBlock)block; |
306 | 308 |
|
307 | 309 | /* |
308 | 310 | @abstract *Asynchronously* send a push message with arbitrary data to a channel. |
|
320 | 322 | */ |
321 | 323 | + (void)sendPushDataToChannelInBackground:(NSString *)channel |
322 | 324 | withData:(NSDictionary *)data |
323 | | - target:(id)target |
324 | | - selector:(SEL)selector; |
| 325 | + target:(PF_NULLABLE_S id)target |
| 326 | + selector:(PF_NULLABLE_S SEL)selector; |
325 | 327 |
|
326 | 328 | /*! |
327 | 329 | @abstract *Synchronously* send a push message with arbitrary data to a query. |
|
366 | 368 | */ |
367 | 369 | + (void)sendPushDataToQueryInBackground:(PFQuery *)query |
368 | 370 | withData:(NSDictionary *)data |
369 | | - block:(PFBooleanResultBlock)block; |
| 371 | + block:(PF_NULLABLE PFBooleanResultBlock)block; |
370 | 372 |
|
371 | 373 | ///-------------------------------------- |
372 | 374 | /// @name Handling Notifications |
|
384 | 386 |
|
385 | 387 | @param userInfo The userInfo dictionary you get in `appplication:didReceiveRemoteNotification:`. |
386 | 388 | */ |
387 | | -+ (void)handlePush:(NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0); |
| 389 | ++ (void)handlePush:(PF_NULLABLE NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0); |
388 | 390 |
|
389 | 391 | ///-------------------------------------- |
390 | 392 | /// @name Managing Channel Subscriptions |
|
407 | 409 |
|
408 | 410 | @returns Returns an `NSSet` containing all the channel names this device is subscribed to. |
409 | 411 | */ |
410 | | -+ (NSSet *)getSubscribedChannels:(NSError **)error; |
| 412 | ++ (PF_NULLABLE NSSet *)getSubscribedChannels:(NSError **)error; |
411 | 413 |
|
412 | 414 | /*! |
413 | 415 | @abstract *Asynchronously* get all the channels that this device is subscribed to. |
|
464 | 466 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)` |
465 | 467 | */ |
466 | 468 | + (void)subscribeToChannelInBackground:(NSString *)channel |
467 | | - block:(PFBooleanResultBlock)block; |
| 469 | + block:(PF_NULLABLE PFBooleanResultBlock)block; |
468 | 470 |
|
469 | 471 | /* |
470 | 472 | @abstract *Asynchronously* subscribes the device to a channel of push notifications and calls the given callback. |
|
478 | 480 | `[result boolValue]` will tell you whether the call succeeded or not. |
479 | 481 | */ |
480 | 482 | + (void)subscribeToChannelInBackground:(NSString *)channel |
481 | | - target:(id)target |
482 | | - selector:(SEL)selector; |
| 483 | + target:(PF_NULLABLE_S id)target |
| 484 | + selector:(PF_NULLABLE_S SEL)selector; |
483 | 485 |
|
484 | 486 | /*! |
485 | 487 | @abstract *Synchronously* unsubscribes the device to a channel of push notifications. |
|
508 | 510 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. |
509 | 511 | */ |
510 | 512 | + (void)unsubscribeFromChannelInBackground:(NSString *)channel |
511 | | - block:(PFBooleanResultBlock)block; |
| 513 | + block:(PF_NULLABLE PFBooleanResultBlock)block; |
512 | 514 |
|
513 | 515 | /* |
514 | 516 | @abstract *Asynchronously* unsubscribes the device from a channel of push notifications and calls the given callback. |
|
521 | 523 | `[result boolValue]` will tell you whether the call succeeded or not. |
522 | 524 | */ |
523 | 525 | + (void)unsubscribeFromChannelInBackground:(NSString *)channel |
524 | | - target:(id)target |
525 | | - selector:(SEL)selector; |
| 526 | + target:(PF_NULLABLE_S id)target |
| 527 | + selector:(PF_NULLABLE_S SEL)selector; |
526 | 528 |
|
527 | 529 | @end |
| 530 | + |
| 531 | +PF_ASSUME_NONNULL_END |
0 commit comments