arcoirislabs / cordova-plugin-mqtt

MqTT Cordova Plugin for Apache Cordova (> v3.0)
MIT License
86 stars 49 forks source link

Publish function sometimes retain false, sometimes true #50

Open mantua75 opened 5 years ago

mantua75 commented 5 years ago

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!

spilz87 commented 3 years ago

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 commented 3 years ago

The bug is known here retain bug

Bit it seems it was not merged