Skip to content
leeway edited this page Nov 19, 2021 · 1 revision

CocoaMQTT5Delegate

CocoaMQTT5 Delegate

@objc public protocol CocoaMQTT5Delegate 

Requirements

mqtt5(_:​didConnectAck:​connAckData:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didConnectAck ack: CocoaMQTTCONNACKReasonCode, connAckData: MqttDecodeConnAck)

mqtt5(_:​didPublishMessage:​id:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didPublishMessage message: CocoaMQTT5Message, id: UInt16)

mqtt5(_:​didPublishAck:​pubAckData:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didPublishAck id: UInt16, pubAckData: MqttDecodePubAck)

mqtt5(_:​didPublishRec:​pubRecData:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didPublishRec id: UInt16, pubRecData: MqttDecodePubRec)

mqtt5(_:​didReceiveMessage:​id:​publishData:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didReceiveMessage message: CocoaMQTT5Message, id: UInt16, publishData: MqttDecodePublish)

mqtt5(_:​didSubscribeTopics:​failed:​subAckData:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didSubscribeTopics success: NSDictionary, failed: [String], subAckData: MqttDecodeSubAck)

mqtt5(_:​didUnsubscribeTopics:​UnsubAckData:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didUnsubscribeTopics topics: [String], UnsubAckData: MqttDecodeUnsubAck)

mqtt5(_:​didReceiveDisconnectReasonCode:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didReceiveDisconnectReasonCode reasonCode: CocoaMQTTDISCONNECTReasonCode)

mqtt5(_:​didReceiveAuthReasonCode:​)

func mqtt5(_ mqtt5: CocoaMQTT5, didReceiveAuthReasonCode reasonCode: CocoaMQTTAUTHReasonCode)

mqtt5DidPing(_:​)

func mqtt5DidPing(_ mqtt5: CocoaMQTT5)

mqtt5DidReceivePong(_:​)

func mqtt5DidReceivePong(_ mqtt5: CocoaMQTT5)

mqtt5DidDisconnect(_:​withError:​)

func mqtt5DidDisconnect(_ mqtt5: CocoaMQTT5, withError err: Error?)

Optional Requirements

mqtt5(_:​didReceive:​completionHandler:​)

Manually validate SSL/TLS server certificate.

@objc optional func mqtt5(_ mqtt5: CocoaMQTT5, didReceive trust: SecTrust, completionHandler: @escaping (Bool) -> Void)

This method will be called if enable allowUntrustCACertificate

mqtt5(_:​didPublishComplete:​pubCompData:​)

@objc optional func mqtt5(_ mqtt5: CocoaMQTT5, didPublishComplete id: UInt16,  pubCompData: MqttDecodePubComp)

mqtt5(_:​didStateChangeTo:​)

@objc optional func mqtt5(_ mqtt5: CocoaMQTT5, didStateChangeTo state: CocoaMQTTConnState)
Types
Protocols
Global Variables
Clone this wiki locally