• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 7.0.0.93
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 #ifndef __has_extension
14 #define __has_extension(x) 0 // Compatibility with non-clang compilers.
15 #endif
16 
17 #if __has_extension(attribute_deprecated_with_message)
18 # define DEPRECATE_PUSH_CONNECT_DISCONNECT __attribute__((deprecated("No longer required")))
19 # define DEPRECATE_GDPUSHCONNECTION __attribute__((deprecated("GDPushConnection interface has been deprecated")))
20 # define DEPRECATE_GDPUSHCHANNELDELEGATE __attribute__((deprecated("GDPushChannelDelegate protocol has been deprecated, use notifications instead.")))
21 #else
22 # define DEPRECATE_PUSH_CONNECT_DISCONNECT __attribute__((deprecated))
23 # define DEPRECATE_GDPUSHCONNECTION __attribute__((deprecated))
24 # define DEPRECATE_GDPUSHCHANNELDELEGATE __attribute__((deprecated))
25 #endif
26 
28 
40 typedef NS_ENUM(NSInteger, GDPushChannelState)
41 {
45 
49 
53 
57 };
58 
85 extern NSString* const GDPushChannelOpenedNotification;
86 
124 extern NSString* const GDPushChannelClosedNotification;
125 
173 extern NSString* const GDPushChannelErrorNotification;
174 
211 extern NSString* const GDPushChannelMessageNotification;
212 
289 extern NSString* const GDPushChannelPingFailedNotification;
290 
310 extern NSString* const GDPushChannelTokenKey;
311 
328 extern NSString* const GDPushChannelMessageKey;
329 
349 extern NSString* const GDPushChannelErrorKey;
350 
399 
436 - (void)onStatus:(int)status;
437 @end
438 
439 
543 @interface GDPushConnection : NSObject {
544 }
545 
557 + (instancetype)sharedConnection;
558 
571 - (BOOL)isConnected;
572 
598 - (void)connect DEPRECATE_PUSH_CONNECT_DISCONNECT;
599 
616 - (void)disconnect DEPRECATE_PUSH_CONNECT_DISCONNECT;
617 
633 @property (GD_NSNULLABLE_PROP nonatomic, weak) id<GDPushConnectionDelegate> delegate;
634 
635 @end
636 
637 
777 
804 - (void)onChannelOpen:(NSString*)token;
805 
840 - (void)onChannelMessage:(NSString*)data;
841 
877 - (void)onChannelClose:(NSString*)data;
878 
924 - (void)onChannelError:(int)error;
925 
987 - (void)onChannelPingFail:(int)error;
988 
989 @end
990 
991 
1423 @interface GDPushChannel : NSObject {
1424  @private
1425  void* m_pushChannelInternal;
1426 }
1427 
1444 @property (GD_NSNULLABLE_PROP nonatomic, weak) id<GDPushChannelDelegate> delegate DEPRECATE_GDPUSHCHANNELDELEGATE;
1445 
1453 @property (nonatomic, readonly) GDPushChannelState state;
1454 
1455 
1467 - (instancetype)initWithIdentifier:(NSString*)pushChannelIdentifier;
1468 
1469 #if __has_extension(attribute_deprecated_with_message)
1470 # define DEPRECATE_PUSH_CHANNEL_INIT __attribute((deprecated("Use initWithIdentifier instead")))
1471 #else
1472 # define DEPRECATE_PUSH_CHANNEL_INIT __attribute((deprecated))
1473 #endif
1474 
1487 - (instancetype)init DEPRECATE_PUSH_CHANNEL_INIT;
1488 
1489 
1513 - (void)connect;
1514 
1540 - (void)disconnect;
1541 
1542 @end
1543 
1545 
1546 #endif /* __GD_PUSH_H__ */
DEPRECATE_GDPUSHCONNECTION
#define DEPRECATE_GDPUSHCONNECTION
Definition: GDPush.h:23
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.
GD_NSNULLABLE_PROP
#define GD_NSNULLABLE_PROP
Definition: GDPortability.h:70
GDPushChannelStateClosed
@ GDPushChannelStateClosed
Definition: GDPush.h:52
DEPRECATE_GDPUSHCHANNELDELEGATE
#define DEPRECATE_GDPUSHCHANNELDELEGATE
Definition: GDPush.h:24
GDPushConnection
Manage Push Channel connection (deprecated).
Definition: GDPush.h:543
GDPushChannelStateError
@ GDPushChannelStateError
Definition: GDPush.h:56
GDPushChannelClosedNotification
NSString *const GDPushChannelClosedNotification
Push Channel closed notification name.
GDPushChannelStateOpen
@ GDPushChannelStateOpen
Definition: GDPush.h:48
GDPushConnectionDelegate-p
Delegate for handling GDPushConnection state transition (deprecated).
Definition: GDPush.h:398
DEPRECATE_PUSH_CHANNEL_INIT
#define DEPRECATE_PUSH_CHANNEL_INIT
Definition: GDPush.h:1472
GDPushChannel
Manage Push Channel tokens and notifications.
Definition: GDPush.h:1423
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.
GD_NS_ASSUME_NONNULL_END
#define GD_NS_ASSUME_NONNULL_END
Definition: GDPortability.h:89
GDPushChannelMessageNotification
NSString *const GDPushChannelMessageNotification
Push Channel received message notification name.
GDPushChannelState
GDPushChannelState
Push Channel state.
Definition: GDPush.h:40
GDPushChannelDelegate-p
Delegate for handling GDPushChannel state transitions and received Push Channel notifications (deprec...
Definition: GDPush.h:776
GDPushChannelStateNone
@ GDPushChannelStateNone
Definition: GDPush.h:44
DEPRECATE_PUSH_CONNECT_DISCONNECT
#define DEPRECATE_PUSH_CONNECT_DISCONNECT
Definition: GDPush.h:22
GDPushChannelTokenKey
NSString *const GDPushChannelTokenKey
Key for the Push Channel token, in a notification user information dictionary.
GD_NS_ASSUME_NONNULL_BEGIN
#define GD_NS_ASSUME_NONNULL_BEGIN
Definition: GDPortability.h:88
GDPortability.h