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