Classes

The following classes are available globally.

  • HYP

    This class is the main entry point for the Hype SDK. It provides facade access to the Hype service running on the background. This class wraps the instance created for the host device. Each app can only create a single instance, which is why class is a singleton and uses class methods. This class allows users of the SDK to listen to events on the created instance by subscribing observers, as well as starting and stopping the Hype services.

    See more

    Declaration

    Objective-C

    @interface HYP

    Swift

    class HYP
  • This class works as a container for error information. This class is extensively used by the SDK, especially in delegates. It holds four main properties: a code, a description, a reason for the error, and a recovery suggestion. Error codes are listed under HYPErrorCode, along with their meaning. The description indicates what went wrong, such as Couldn’t send a message. The reason indicates the cause, such as Bluetooth is not turned on. Continuing on the same example, the recovery suggestion indicates a possible recovery from the error, such as Try turning Bluetooth on.

    See more

    Declaration

    Objective-C

    @interface HYPError

    Swift

    class HYPError
  • Instances map to devices participating on the network. Instances are advertised on the network and, when found, a notification is issued indicating that the instance is available for communication purposes. Usually, there’s no need to instantiate objects of this type at all, as the framework handles that automatically. Instance identifiers are unique for each device, and are devided in three parts: an app identifier, a device identifier, and a user identifier. The app identifier is always the same, as Hype fragments the network using that, so the app never needs to deal with instances from different vendors. Device identifiers are automatically assigned by the SDK. The user identifier is a custom optional setting, and can be used to help identify the user running an unresolved instance, although that consists of a 31bit (not 32!) that can be used for any purpose the app may need. Collectively, the three identifiers form what is called a global identifier, which can be queried with the - identifier property. Such identifiers are between 6 and 12 bytes long and uniquely identify each device on the network.

    See more

    Declaration

    Objective-C

    @interface HYPInstance

    Swift

    class HYPInstance
  • Messages are abstract entities that help keeping track of data as it is sent over the network, by holding a unique identifier. The identifier is actually held by the underlying HYPMessageInfo instance (-info), but the HYPMessage class provides dynamic access to that attribute. This is mostly motivated by the fact that Hype does not keep messages for memory purposes. As such, it’s up to the developer to hold or discard the data as needed. Instead, HYPMessageInfo instances are used to keep track of the state of any given HYPMessage.

    See more

    Declaration

    Objective-C

    @interface HYPMessage

    Swift

    class HYPMessage
  • This class is used to hold message metadata. At this point, it only includes the message identifier, but this will change with future releases. It’s mostly useful to associate messages with the metadata, as Hype notifications usually use instances of this class and not HYPMessage. This is motivated by the fact that HYPMessage holds the message’s payload, which would consume more memory.

    See more

    Declaration

    Objective-C

    @interface HYPMessageInfo

    Swift

    class HYPMessageInfo