cordova-plugin-mqtt icon indicating copy to clipboard operation
cordova-plugin-mqtt copied to clipboard

Publish function sometimes retain false, sometimes true

Open mantua75 opened this issue 6 years ago • 2 comments

Hi everybody, I'm using this great plugin and I create a function to send message.

function mqttSend(thisTopic,thisPayload,callback){

cordova.plugins.CordovaMqTTPlugin.publish({
   topic:thisTopic,
   payload:thisPayload,
   qos:0,
   retain:false,
   success:function(s){	   	
   	console.log("Mqtt send OK");
   	if(callback!==undefined){
   		callback(1);
   	}
   },
   error:function(e){
   	console.log("Mqtt send error");
   	console.log(e);
   	callback(-1);
   }
})

}

If I check the logs on the server that receives the messages it tells me some sendings are with retain false and others with retail true but the function is always the same.

Has anyone encountered the same problem?

Thanks!

mantua75 avatar Apr 09 '19 13:04 mantua75

Hello

I have exactly the same issue

Did you solve it ?

Or someone has any idea about how to solve it ?

Thanks in advance

spilz87 avatar Aug 05 '21 14:08 spilz87

The bug is known here retain bug

Bit it seems it was not merged

spilz87 avatar Aug 05 '21 14:08 spilz87