Protocols
The following protocols are available globally.
-
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, or that it 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 yet support progress tracking on the receiving end, meaning that the destination only gets the message when it has been fully dilevered. Other events include messages being received using-hype:didReceiveMessage:fromInstance:
or failed sending, with-hype:didFailSendingMessage:toInstance:error:
.Declaration
Objective-C
@protocol HYPMessageObserver
Swift
protocol HYPMessageObserver
-
Network observers handle network events, such as instances being found and lost on the network.
See moreDeclaration
Objective-C
@protocol HYPNetworkObserver
Swift
protocol HYPNetworkObserver
-
State observers handle Hype state change events, such as the framework starting, and stopping, among others. This is helpful for tracking the framework’s lifecycle. The instance must be registered with the HYP singleton using the method
See more-addStateObserver:
. Notifications include Hype’s life cycle.Declaration
Objective-C
@protocol HYPStateObserver
Swift
protocol HYPStateObserver