PayloadDataSupplier

public protocol PayloadDataSupplier

Payload data supplier for generating payload data that is shared with other devices to provide device identity information while maintaining privacy and security. Implement this to integration your solution with this transport.

  • legacyPayload(_:device:) Default implementation

    Legacy payload supplier callback - for those transitioning their apps to Herald. Note: Device may be null if Payload in use is same for all receivers

    Default Implementation

    Default implementation returns nil.

    Declaration

    Swift

    func legacyPayload(_ timestamp: PayloadTimestamp, device: Device?) -> LegacyPayloadData?
  • Get payload for given timestamp. Use this for integration with any payload generator. Note: Device may be null if Payload in use is same for all receivers

    Declaration

    Swift

    func payload(_ timestamp: PayloadTimestamp, device: Device?) -> PayloadData?
  • payload(_:) Default implementation

    Parse raw data into payloads. This is used to split concatenated payloads that are transmitted via share payload. The default implementation assumes payload data is fixed length.

    Default Implementation

    Default implementation assumes fixed length payload data.

    Declaration

    Swift

    func payload(_ data: Data) -> [PayloadData]