emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.57k stars 411 forks source link

No userProperty info back to client in publish ack message. #588

Open fighting300 opened 2 months ago

fighting300 commented 2 months ago

Hello, there, when i publish a message with userProperty, I didnot get the userProperty from message ack body. why? I use mqtt protocal 5.0, and the code is blow

` _pubProp = [[MqttPublishProperties alloc] initWithContentType:@"JSON"]; [_pubProp setUserProperty:@{@"uuid": uuid}]; [_mqtt5 publish:@"dragonTopic/3" withString:@"test" qos:CocoaMQTTQoSQos1 DUP:YES retained:YES properties:_pubProp];

func didReceive(_ reader: CocoaMQTTReader, puback: FramePubAck) {
    printDebug("RECV: \(puback) test2 \(String(describing: puback.pubAckProperties?.userProperty)) test1 \(String(describing: puback.userProperties))")
    deliver.ack(by: puback)

    delegate?.mqtt5(self, didPublishAck: puback.msgid, pubAckData: puback.pubAckProperties ?? nil)
    didPublishAck(self, puback.msgid, puback.pubAckProperties ?? nil)
}

` I want get the same user property what i send, how can i get to this result。 thanks for giving help to me

JaylinYu commented 1 month ago

Broker's job not sdk.