LuxChat  2.0
Instant messenger for iOS
PFPush.h
1 
10 #import <Foundation/Foundation.h>
11 
12 #import <Bolts/BFTask.h>
13 
14 #import <Parse/PFConstants.h>
15 #import <Parse/PFInstallation.h>
16 
17 PF_TV_UNAVAILABLE_WARNING
18 PF_WATCH_UNAVAILABLE_WARNING
19 
21 
22 NS_ASSUME_NONNULL_BEGIN
23 
30 PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject<NSCopying>
31 
33 #pragma mark - Creating a Push Notification
34 
36 + (instancetype)push;
37 
39 #pragma mark - Configuring a Push Notification
40 
48 - (void)setChannel:(nullable NSString *)channel;
49 
56 - (void)setChannels:(nullable NSArray<NSString *> *)channels;
57 
65 - (void)setQuery:(nullable PFQuery<PFInstallation *> *)query;
66 
74 - (void)setMessage:(nullable NSString *)message;
75 
85 - (void)setData:(nullable NSDictionary *)data;
86 
94 - (void)setPushToAndroid:(BOOL)pushToAndroid PARSE_DEPRECATED("Please use a [PFInstallation query] with a constraint on deviceType. This method is deprecated and won't do anything.");
95 
103 - (void)setPushToIOS:(BOOL)pushToIOS PARSE_DEPRECATED("Please use a [PFInstallation query] with a constraint on deviceType. This method is deprecated and won't do anything.");
104 
117 - (void)expireAtDate:(nullable NSDate *)date;
118 
130 - (void)expireAfterTimeInterval:(NSTimeInterval)timeInterval;
131 
135 - (void)clearExpiration;
136 
144 @property (nullable, nonatomic, strong) NSDate *pushDate;
145 
147 #pragma mark - Sending Push Notifications
148 
159 + (BFTask<NSNumber *> *)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message;
160 
170 + (void)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message block:(nullable PFBooleanResultBlock)block;
171 
180 + (BFTask<NSNumber *> *)sendPushMessageToQueryInBackground:(PFQuery<PFInstallation *> *)query
181  withMessage:(NSString *)message;
182 
192 + (void)sendPushMessageToQueryInBackground:(PFQuery<PFInstallation *> *)query
193  withMessage:(NSString *)message
194  block:(nullable PFBooleanResultBlock)block;
195 
200 - (BFTask<NSNumber *> *)sendPushInBackground;
201 
208 - (void)sendPushInBackgroundWithBlock:(nullable PFBooleanResultBlock)block;
209 
221 + (BFTask<NSNumber *> *)sendPushDataToChannelInBackground:(NSString *)channel withData:(NSDictionary *)data;
222 
234 + (void)sendPushDataToChannelInBackground:(NSString *)channel
235  withData:(NSDictionary *)data
236  block:(nullable PFBooleanResultBlock)block;
237 
249 + (BFTask<NSNumber *> *)sendPushDataToQueryInBackground:(PFQuery<PFInstallation *> *)query
250  withData:(NSDictionary *)data;
251 
263 + (void)sendPushDataToQueryInBackground:(PFQuery<PFInstallation *> *)query
264  withData:(NSDictionary *)data
265  block:(nullable PFBooleanResultBlock)block;
266 
268 #pragma mark - Handling Notifications
269 
283 + (void)handlePush:(nullable NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0) PF_EXTENSION_UNAVAILABLE("");
284 
286 #pragma mark - Managing Channel Subscriptions
287 
297 + (void)storeDeviceToken:(id)deviceToken;
298 
304 + (BFTask<NSSet<NSString *> *> *)getSubscribedChannelsInBackground;
305 
311 + (void)getSubscribedChannelsInBackgroundWithBlock:(PFSetResultBlock)block;
312 
321 + (BFTask<NSNumber *> *)subscribeToChannelInBackground:(NSString *)channel;
322 
331 + (void)subscribeToChannelInBackground:(NSString *)channel block:(nullable PFBooleanResultBlock)block;
332 
340 + (BFTask<NSNumber *> *)unsubscribeFromChannelInBackground:(NSString *)channel;
341 
349 + (void)unsubscribeFromChannelInBackground:(NSString *)channel block:(nullable PFBooleanResultBlock)block;
350 
351 @end
352 
353 NS_ASSUME_NONNULL_END
Definition: PFObject+Subclass.h:14
Definition: PFImageView.h:32
Definition: PFInstallation.h:38