Kommunicate-io / Kommunicate-Cordova-Ionic-PhoneGap-Chat-Plugin

Kommunicate plugin for Ionic/Phonegap/Cordova
BSD 3-Clause "New" or "Revised" License
21 stars 15 forks source link

Different clientChannelKey when creating conversation in Android and iOS #27

Open arturomf opened 3 years ago

arturomf commented 3 years ago

Hi, i'm using this plugin in an Ionic 5 app and webhooks to update my server.

Webhook is sending this info to my server :

{
    "key":"message key",
    "from":"sender unique id",
    "groupId": 55468490,              
    "clientGroupId": "giuliana@lullaai.com_xdkcpemqpepbp8ktfmmwnuhndrl2",     
    "groupName": "Conversation",  
    "message":"message content",
    "timeStamp":1457958424000,  // Long timestamp value
    "receiverConnected": true,  // Boolean value
    "receiverLastSeenAtTime": 1457958424000 //Long timestamp value
  }

When I create a conversation using this code, I'm saving clientChannelKey in my server attached to the user that starts the conversation, so I can identify it when I receive a webhook.

kommunicate.conversationBuilder(conversationObject, (clientChannelKey) => {
     console.log("Kommunicate create conversation successful the clientChannelKey is : " + clientChannelKey);
  }, (error) =>{
      console.log("Kommunicate create conversation failed : " + error);
  });

After testing in iOS, I have noticed that clientChannelKey when creating conversation is the same clientGroupId that I get in weebhook. But in Android, clientChannelKey is the same groupId in webhook instead oif clientGroupId.

Is that a bug? or is intended?

Thanks!

Samir1810 commented 3 years ago

@arturomf Adding our mobile developer @reytum to take a look. We'll update you ASAP.

reytum commented 3 years ago

Hi, i'm using this plugin in an Ionic 5 app and webhooks to update my server.

Webhook is sending this info to my server :

{
    "key":"message key",
    "from":"sender unique id",
    "groupId": 55468490,              
    "clientGroupId": "giuliana@lullaai.com_xdkcpemqpepbp8ktfmmwnuhndrl2",     
    "groupName": "Conversation",  
    "message":"message content",
    "timeStamp":1457958424000,  // Long timestamp value
    "receiverConnected": true,  // Boolean value
    "receiverLastSeenAtTime": 1457958424000 //Long timestamp value
  }

When I create a conversation using this code, I'm saving clientChannelKey in my server attached to the user that starts the conversation, so I can identify it when I receive a webhook.

kommunicate.conversationBuilder(conversationObject, (clientChannelKey) => {
     console.log("Kommunicate create conversation successful the clientChannelKey is : " + clientChannelKey);
  }, (error) =>{
      console.log("Kommunicate create conversation failed : " + error);
  });

After testing in iOS, I have noticed that clientChannelKey when creating conversation is the same clientGroupId that I get in weebhook. But in Android, clientChannelKey is the same groupId in webhook instead oif clientGroupId.

Is that a bug? or is intended?

Thanks!

@arturomf It's Intented. It have been like that always. Android returns the channelKey and iOS return the clientChannelKey. No one pointed it out earlier has this key wasn't used for any purpose once the conversation was launched. We'll see what we can do about it.

arturomf commented 3 years ago

Hi, I have handled it (in different way in Android and iOS) but I think that conversationBuilder should return the same conversation identifier in all platforms.

Thanks for the answer.

El jue, 11 mar 2021 a las 7:06, Ashish Kanswal @.***>) escribió:

Hi, i'm using this plugin in an Ionic 5 app and webhooks to update my server.

Webhook is sending this info to my server :

{ "key":"message key", "from":"sender unique id", "groupId": 55468490, "clientGroupId": @.***_xdkcpemqpepbp8ktfmmwnuhndrl2", "groupName": "Conversation", "message":"message content", "timeStamp":1457958424000, // Long timestamp value "receiverConnected": true, // Boolean value "receiverLastSeenAtTime": 1457958424000 //Long timestamp value }

When I create a conversation using this code, I'm saving clientChannelKey in my server attached to the user that starts the conversation, so I can identify it when I receive a webhook.

kommunicate.conversationBuilder(conversationObject, (clientChannelKey) => { console.log("Kommunicate create conversation successful the clientChannelKey is : " + clientChannelKey); }, (error) =>{ console.log("Kommunicate create conversation failed : " + error); });

After testing in iOS, I have noticed that clientChannelKey when creating conversation is the same clientGroupId that I get in weebhook. But in Android, clientChannelKey is the same groupId in webhook instead oif clientGroupId.

Is that a bug? or is intended?

Thanks!

@arturomf https://github.com/arturomf It's Intented. It have been like that always. Android returns the channelKey and iOS return the clientChannelKey. No one pointed it out earlier has this key wasn't used for any purpose once the conversation was launched. We'll see what we can do about it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kommunicate-io/Kommunicate-Cordova-Ionic-PhoneGap-Chat-Plugin/issues/27#issuecomment-796483531, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADICO3YEUF7IUXS5TVHEWM3TDBMU5ANCNFSM4Y5VVMRA .

-- Arturo Macías Fernández Web design - Mobile - Gaming Teléfono: 679446436

Plaza del Sol 31, 1ª Planta, Oficina 11 28938 Móstoles, Madrid www.qualitydevs.com

AVISO LEGAL: Esta información es privada y confidencial y esta dirigida únicamente a su destinatario. Si usted no es el destinatario original de este mensaje y por este medio pudo acceder a dicha información por favor elimine el mensaje. La distribución o copia de este mensaje está estrictamente prohibida. Esta comunicación es sólo para propósitos de información. La transmisión de e-mails no garantiza que el correo electrónico sea seguro o libre de error. Por consiguiente, no manifestamos que esta información sea completa o precisa. Toda información está sujeta a alterarse sin previo aviso. LEGAL NOTICE: This information is private and confidential and intended for the recipient only. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.

reytum commented 3 years ago

@arturomf We will fix it in the next release. Thanks.