Skip to content

Commit e731fb9

Browse files
committed
Add nullability annotations to PFPush.
1 parent 7e0afe6 commit e731fb9

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

Parse/PFPush.h

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
@class BFTask;
1515
@class PFQuery;
1616

17+
PF_ASSUME_NONNULL_BEGIN
18+
1719
/*!
1820
The `PFPush` class defines a push notification that can be sent from a client device.
1921
@@ -38,15 +40,15 @@
3840
@param channel The channel to set for this push.
3941
The channel name must start with a letter and contain only letters, numbers, dashes, and underscores.
4042
*/
41-
- (void)setChannel:(NSString *)channel;
43+
- (void)setChannel:(PF_NULLABLE NSString *)channel;
4244

4345
/*!
4446
@abstract Sets the array of channels on which this push notification will be sent.
4547
4648
@param channels The array of channels to set for this push.
4749
Each channel name must start with a letter and contain only letters, numbers, dashes, and underscores.
4850
*/
49-
- (void)setChannels:(NSArray *)channels;
51+
- (void)setChannels:(PF_NULLABLE NSArray *)channels;
5052

5153
/*!
5254
@abstract Sets an installation query to which this push notification will be sent.
@@ -55,7 +57,7 @@
5557
5658
@param query The installation query to set for this push.
5759
*/
58-
- (void)setQuery:(PFQuery *)query;
60+
- (void)setQuery:(PF_NULLABLE PFQuery *)query;
5961

6062
/*!
6163
@abstract Sets an alert message for this push notification.
@@ -64,7 +66,7 @@
6466
6567
@param message The message to send in this push.
6668
*/
67-
- (void)setMessage:(NSString *)message;
69+
- (void)setMessage:(PF_NULLABLE NSString *)message;
6870

6971
/*!
7072
@abstract Sets an arbitrary data payload for this push notification.
@@ -75,7 +77,7 @@
7577
7678
@param data The data to send in this push.
7779
*/
78-
- (void)setData:(NSDictionary *)data;
80+
- (void)setData:(PF_NULLABLE NSDictionary *)data;
7981

8082
/*!
8183
@abstract Sets whether this push will go to Android devices.
@@ -107,7 +109,7 @@
107109
108110
@param date The time at which the notification should expire.
109111
*/
110-
- (void)expireAtDate:(NSDate *)date;
112+
- (void)expireAtDate:(PF_NULLABLE NSDate *)date;
111113

112114
/*!
113115
@abstract Sets the time interval after which this notification should expire.
@@ -168,7 +170,7 @@
168170
*/
169171
+ (void)sendPushMessageToChannelInBackground:(NSString *)channel
170172
withMessage:(NSString *)message
171-
block:(PFBooleanResultBlock)block;
173+
block:(PF_NULLABLE PFBooleanResultBlock)block;
172174

173175
/*
174176
@abstract *Asynchronously* send a push message to a channel.
@@ -184,8 +186,8 @@
184186
*/
185187
+ (void)sendPushMessageToChannelInBackground:(NSString *)channel
186188
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;
189191

190192
/*!
191193
@abstract Send a push message to a query.
@@ -222,7 +224,7 @@
222224
*/
223225
+ (void)sendPushMessageToQueryInBackground:(PFQuery *)query
224226
withMessage:(NSString *)message
225-
block:(PFBooleanResultBlock)block;
227+
block:(PF_NULLABLE PFBooleanResultBlock)block;
226228

227229
/*!
228230
@abstract *Synchronously* send this push message.
@@ -245,7 +247,7 @@
245247
@param block The block to execute.
246248
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
247249
*/
248-
- (void)sendPushInBackgroundWithBlock:(PFBooleanResultBlock)block;
250+
- (void)sendPushInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
249251

250252
/*
251253
@abstract *Asynchronously* send this push message and calls the given callback.
@@ -256,7 +258,7 @@
256258
`error` will be `nil` on success and set if there was an error.
257259
`[result boolValue]` will tell you whether the call succeeded or not.
258260
*/
259-
- (void)sendPushInBackgroundWithTarget:(id)target selector:(SEL)selector;
261+
- (void)sendPushInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
260262

261263
/*!
262264
@abstract *Synchronously* send a push message with arbitrary data to a channel.
@@ -301,7 +303,7 @@
301303
*/
302304
+ (void)sendPushDataToChannelInBackground:(NSString *)channel
303305
withData:(NSDictionary *)data
304-
block:(PFBooleanResultBlock)block;
306+
block:(PF_NULLABLE PFBooleanResultBlock)block;
305307

306308
/*
307309
@abstract *Asynchronously* send a push message with arbitrary data to a channel.
@@ -319,8 +321,8 @@
319321
*/
320322
+ (void)sendPushDataToChannelInBackground:(NSString *)channel
321323
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;
324326

325327
/*!
326328
@abstract *Synchronously* send a push message with arbitrary data to a query.
@@ -365,7 +367,7 @@
365367
*/
366368
+ (void)sendPushDataToQueryInBackground:(PFQuery *)query
367369
withData:(NSDictionary *)data
368-
block:(PFBooleanResultBlock)block;
370+
block:(PF_NULLABLE PFBooleanResultBlock)block;
369371

370372
///--------------------------------------
371373
/// @name Handling Notifications
@@ -383,7 +385,7 @@
383385
384386
@param userInfo The userInfo dictionary you get in `appplication:didReceiveRemoteNotification:`.
385387
*/
386-
+ (void)handlePush:(NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0);
388+
+ (void)handlePush:(PF_NULLABLE NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0);
387389

388390
///--------------------------------------
389391
/// @name Managing Channel Subscriptions
@@ -406,7 +408,7 @@
406408
407409
@returns Returns an `NSSet` containing all the channel names this device is subscribed to.
408410
*/
409-
+ (NSSet *)getSubscribedChannels:(NSError **)error;
411+
+ (PF_NULLABLE NSSet *)getSubscribedChannels:(NSError **)error;
410412

411413
/*!
412414
@abstract *Asynchronously* get all the channels that this device is subscribed to.
@@ -463,7 +465,7 @@
463465
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`
464466
*/
465467
+ (void)subscribeToChannelInBackground:(NSString *)channel
466-
block:(PFBooleanResultBlock)block;
468+
block:(PF_NULLABLE PFBooleanResultBlock)block;
467469

468470
/*
469471
@abstract *Asynchronously* subscribes the device to a channel of push notifications and calls the given callback.
@@ -477,8 +479,8 @@
477479
`[result boolValue]` will tell you whether the call succeeded or not.
478480
*/
479481
+ (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;
482484

483485
/*!
484486
@abstract *Synchronously* unsubscribes the device to a channel of push notifications.
@@ -507,7 +509,7 @@
507509
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
508510
*/
509511
+ (void)unsubscribeFromChannelInBackground:(NSString *)channel
510-
block:(PFBooleanResultBlock)block;
512+
block:(PF_NULLABLE PFBooleanResultBlock)block;
511513

512514
/*
513515
@abstract *Asynchronously* unsubscribes the device from a channel of push notifications and calls the given callback.
@@ -520,7 +522,9 @@
520522
`[result boolValue]` will tell you whether the call succeeded or not.
521523
*/
522524
+ (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;
525527

526528
@end
529+
530+
PF_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)