Protocols
The following protocols are available globally.
-
@abstract Message observers.
@discussion Message observers listen to message events, such as messages being received, sent, delivered, or failing. The concepts of
See moresending
anddelivering
are important to distinguish. A message beingsent
indicates that it was written to the output streams, but not necessarily delivered to it’s destination. This only means that the content is circulating on the network, and as such might not have left the device yet. A message beingdelivered
, on the other hand, indicates that its destination has acknowledge reception and the content is already available on the end device. Messages being written to the output streams are indicated by the -hype:didSendMessage:toInstance:progress:complete: event. A message being delivered is indicated by -hype:didDeliverMessage:toInstance:progress:complete:. Hype does not indicate partial reception yet (that is, a didReceive method with progress tracking), so the end device is only notified when the message is fully received. Other events include messages being received (-hype:didReceiveMessage:fromInstance:) or failed sending (-hype:didFailSendingMessage:toInstance:error:).Declaration
Objective-C
@protocol HYPMessageObserver <NSObject>
Swift
protocol HYPMessageObserver : NSObjectProtocol
-
@abstract Network observer.
@discussion Network observers handle network events, such as instances being found and lost on the network.
See moreDeclaration
Objective-C
@protocol HYPNetworkObserver <NSObject>
Swift
protocol HYPNetworkObserver : NSObjectProtocol
-
@abstract State observer.
@discussion State observers handle Hype state change events, such as the framework starting, stopping, among others. This is helpful for tracking the framework’s lifecycle. The instance must be registered with the HYP singleton using the method -addStateObserver:. Notifications include Hype’s life cycle.
See moreDeclaration
Objective-C
@protocol HYPStateObserver <NSObject>
Swift
protocol HYPStateObserver : NSObjectProtocol