Constants

The following constants are available globally.

  • @abstract Identifier option key.

    @discussion Hype automatically generates an identifier for each device on the network. These identifiers, however, are meaningless to the developer because they are only managed internally. This optional key allows setting a custom byte array of up to 8 bytes, giving the developer some control over identifier generation. It’s notable that identifiers are always 16 bytes long, regardless of how many bytes are passed along with this key. Hype uses the rest of the available space to store the realm and add randomness to the identifier, thus guaranteeing uniqueness. As such, there’s no risk of collisions in using, say, user identifiers, even if they have several devices participating on the network. Doing so would help identify the user as soon as an instance is found. If this key is not set, Hype automatically generates an identifier for the local instance.

    Declaration

    Objective-C

    extern NSString *const HYPOptionIdentifierKey
  • @abstract Realm option key.

    @discussion This key allows setting the realm for the local instance, which is used for matching purposes. Realms are used to segregate the network and optimizing the matching process. Access Hype’s website to generate a realm that is unique to this implementation. Realms are mandatory and should be set using a string in hexadecimal format. The framework will attempt to parse this string has such and will throw an exception if that is not possible. Realms are 8 hexadecimal digits long, and this is also validated.

    Declaration

    Objective-C

    extern NSString *const HYPOptionRealmKey
  • @abstract No transport type.

    @discussion Constant indicating the absence of any type of transport.

    Declaration

    Objective-C

    extern const HYPTransportType HYPTransportTypeNone

    Swift

    let HYPTransportTypeNone: HYPTransportType
  • @abstract All available types of transport.

    @discussion This constant is used to signify all available types of transport instead of relying on bitwise operators while listing all available constants.

    Declaration

    Objective-C

    extern const HYPTransportType HYPTransportTypeAll

    Swift

    let HYPTransportTypeAll: HYPTransportType
  • @abstract The Bonjour transport type.

    @discussion Bonjour is a mixed transport type that includes Infrastructural Wi-Fi, Wi-Fi Direct, and Bluetooth Classic.

    Declaration

    Objective-C

    extern const HYPTransportType HYPTransportTypeBonjour

    Swift

    let HYPTransportTypeBonjour: HYPTransportType