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

CocoaMQTTDelegate

CocoaMQTT Delegate

@objc public protocol CocoaMQTTDelegate 

Requirements

mqtt(_:​didConnectAck:​)

func mqtt(_ mqtt: CocoaMQTT, didConnectAck ack: CocoaMQTTConnAck)

mqtt(_:​didPublishMessage:​id:​)

func mqtt(_ mqtt: CocoaMQTT, didPublishMessage message: CocoaMQTTMessage, id: UInt16)

mqtt(_:​didPublishAck:​)

func mqtt(_ mqtt: CocoaMQTT, didPublishAck id: UInt16)

mqtt(_:​didReceiveMessage:​id:​)

func mqtt(_ mqtt: CocoaMQTT, didReceiveMessage message: CocoaMQTTMessage, id: UInt16 )

mqtt(_:​didSubscribeTopics:​failed:​)

func mqtt(_ mqtt: CocoaMQTT, didSubscribeTopics success: NSDictionary, failed: [String])

mqtt(_:​didUnsubscribeTopics:​)

func mqtt(_ mqtt: CocoaMQTT, didUnsubscribeTopics topics: [String])

mqttDidPing(_:​)

func mqttDidPing(_ mqtt: CocoaMQTT)

mqttDidReceivePong(_:​)

func mqttDidReceivePong(_ mqtt: CocoaMQTT)

mqttDidDisconnect(_:​withError:​)

func mqttDidDisconnect(_ mqtt: CocoaMQTT, withError err: Error?)

Optional Requirements

mqtt(_:​didReceive:​completionHandler:​)

Manually validate SSL/TLS server certificate.

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

This method will be called if enable allowUntrustCACertificate

mqtt(_:​didPublishComplete:​)

@objc optional func mqtt(_ mqtt: CocoaMQTT, didPublishComplete id: UInt16)

mqtt(_:​didStateChangeTo:​)

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