• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 10.0.1.86
GDPush.h
Go to the documentation of this file.
1 /*
2  * (c) 2018 BlackBerry Limited. All rights reserved.
3  *
4  */
5 
6 #ifndef __GD_PUSH_H__
7 #define __GD_PUSH_H__
8 
9 #import <Foundation/Foundation.h>
10 #import "GDPortability.h"
11 
12 // See: http://clang.llvm.org/docs/LanguageExtensions.html
13 /* \cond DOXYGEN_IGNORE */
14 #ifndef __has_extension
15 #define __has_extension(x) 0 // Compatibility with non-clang compilers.
16 #endif
17 /* \endcond */
18 
19 /* \cond DOXYGEN_IGNORE */
20 #if __has_extension(attribute_deprecated_with_message)
21 # define DEPRECATE_PUSH_CONNECT_DISCONNECT __attribute__((deprecated("No longer required")))
22 # define DEPRECATE_GDPUSHCONNECTION __attribute__((deprecated("GDPushConnection interface has been deprecated")))
23 # define DEPRECATE_GDPUSHCHANNELDELEGATE __attribute__((deprecated("GDPushChannelDelegate protocol has been deprecated, use notifications instead.")))
24 #else
25 # define DEPRECATE_PUSH_CONNECT_DISCONNECT __attribute__((deprecated))
26 # define DEPRECATE_GDPUSHCONNECTION __attribute__((deprecated))
27 # define DEPRECATE_GDPUSHCHANNELDELEGATE __attribute__((deprecated))
28 #endif
29 /* \endcond */
30 
31 NS_ASSUME_NONNULL_BEGIN
32 
44 typedef NS_ENUM(NSInteger, GDPushChannelState)
45 {
49 
53 
57 
61 };
62 
92 extern NSString* const GDPushChannelOpenedNotification;
93 
131 extern NSString* const GDPushChannelClosedNotification;
132 
180 extern NSString* const GDPushChannelErrorNotification;
181 
218 extern NSString* const GDPushChannelMessageNotification;
219 
296 extern NSString* const GDPushChannelPingFailedNotification;
297 
317 extern NSString* const GDPushChannelTokenKey;
318 
335 extern NSString* const GDPushChannelHostKey;
336 
353 extern NSString* const GDPushChannelMessageKey;
354 
374 extern NSString* const GDPushChannelErrorKey;
375 
422 DEPRECATE_GDPUSHCONNECTION
424 
461 - (void)onStatus:(int)status;
462 @end
463 
464 
567 DEPRECATE_GDPUSHCONNECTION
568 @interface GDPushConnection : NSObject {
569 }
570 
582 + (instancetype)sharedConnection;
583 
596 - (BOOL)isConnected;
597 
623 - (void)connect DEPRECATE_PUSH_CONNECT_DISCONNECT;
624 
641 - (void)disconnect DEPRECATE_PUSH_CONNECT_DISCONNECT;
642 
658 @property (nullable, nonatomic, weak) id<GDPushConnectionDelegate> delegate;
659 
660 @end
661 
662 
800 DEPRECATE_GDPUSHCHANNELDELEGATE
802 
829 - (void)onChannelOpen:(NSString*)token;
830 
865 - (void)onChannelMessage:(NSString*)data;
866 
902 - (void)onChannelClose:(NSString*)data;
903 
949 - (void)onChannelError:(int)error;
950 
1012 - (void)onChannelPingFail:(int)error;
1013 
1014 @end
1015 
1016 
1454 @interface GDPushChannel : NSObject {
1455  @private
1456  void* m_pushChannelInternal;
1457 }
1458 
1475 @property (nullable, nonatomic, weak) id<GDPushChannelDelegate> delegate DEPRECATE_GDPUSHCHANNELDELEGATE;
1476 
1484 @property (nonatomic, readonly) GDPushChannelState state;
1485 
1486 
1498 - (instancetype)initWithIdentifier:(NSString*)pushChannelIdentifier;
1499 
1500 /* \cond DOXYGEN_IGNORE */
1501 #if __has_extension(attribute_deprecated_with_message)
1502 # define DEPRECATE_PUSH_CHANNEL_INIT __attribute((deprecated("Use initWithIdentifier instead")))
1503 #else
1504 # define DEPRECATE_PUSH_CHANNEL_INIT __attribute((deprecated))
1505 #endif
1506 /* \endcond */
1507 
1520 - (instancetype)init DEPRECATE_PUSH_CHANNEL_INIT;
1521 
1522 
1547 - (void)connect;
1548 
1574 - (void)disconnect;
1575 
1576 @end
1577 
1578 NS_ASSUME_NONNULL_END
1579 
1580 #endif /* __GD_PUSH_H__ */
GDPushChannelOpenedNotification
NSString *const GDPushChannelOpenedNotification
Push Channel opened notification name.
GDPushChannelMessageKey
NSString *const GDPushChannelMessageKey
Key for the message data, in a Push Channel notification user information dictionary.
GDPushChannelStateClosed
@ GDPushChannelStateClosed
Definition: GDPush.h:56
GDPushChannelHostKey
NSString *const GDPushChannelHostKey
Key for the Push Channel host name, in a notification user information dictionary.
GDPushConnection
Manage Push Channel connection (deprecated).
Definition: GDPush.h:568
GDPushChannelStateError
@ GDPushChannelStateError
Definition: GDPush.h:60
GDPushChannelClosedNotification
NSString *const GDPushChannelClosedNotification
Push Channel closed notification name.
GDPushChannelStateOpen
@ GDPushChannelStateOpen
Definition: GDPush.h:52
GDPushConnectionDelegate-p
Delegate for handling GDPushConnection state transition (deprecated).
Definition: GDPush.h:423
GDPushChannel
Manage Push Channel tokens and notifications.
Definition: GDPush.h:1454
GDPushChannelErrorKey
NSString *const GDPushChannelErrorKey
Key for the error code, in a Push Channel notification user information dictionary.
GDPushChannelPingFailedNotification
NSString *const GDPushChannelPingFailedNotification
Push Channel ping failed on server notification name.
GDPushChannelErrorNotification
NSString *const GDPushChannelErrorNotification
Push Channel error notification name.
GDPushChannelMessageNotification
NSString *const GDPushChannelMessageNotification
Push Channel received message notification name.
GDPushChannelState
GDPushChannelState
Push Channel state.
Definition: GDPush.h:44
GDPushChannelDelegate-p
Delegate for handling GDPushChannel state transitions and received Push Channel notifications (deprec...
Definition: GDPush.h:801
GDPushChannelStateNone
@ GDPushChannelStateNone
Definition: GDPush.h:48
GDPushChannelTokenKey
NSString *const GDPushChannelTokenKey
Key for the Push Channel token, in a notification user information dictionary.
GDPortability.h