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 sending and delivering are important to distinguish. A message being sent 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 being delivered, 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:).

    See more

    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 more

    Declaration

    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 more

    Declaration

    Objective-C

    @protocol HYPStateObserver <NSObject>

    Swift

    protocol HYPStateObserver : NSObjectProtocol