Freshchat conversation data methods

Hi team,

Hope you will be fine,

I am here to give a feedback according to the issue i am still facing in Freshchat conversation. In chat conversation event they return first time conversation details and whenever I switch the conversation event does not trigger, it works on page refresh it may be a user interface problem.

Your urgent consideration of this issue will be highly appreciated . I hope this would be valuable feedback. Thanks

Freshchat data method documentation

video also attached link

Hi @mirza_has

Can you share the app.js code snippet and the version of the FDK you are on?

I was not able to replicate this issue in my test instance.

1 Like

Hi @Arjun_Paliath

Yes sure , We are still facing this issue. Can you please look into it?

FDK version: Installed: 6.8.0

App code:
app.js link

Thanks

Hi @mirza_has, can you please try the below code snippet. Make sure that you are retrieving the data after the ap activated event has triggered.

var client;

document.onreadystatechange = function () {
  if (document.readyState === 'interactive') renderApp();

  function renderApp() {
    var onInit = app.initialized();

    onInit.then(getClient).catch(handleErr);

    function getClient(_client) {
      client = _client;
      client.events.on('app.activated', getData)
    }
    function getData() {
      client.data.get("conversation").then(function (data) {
        console.log("conversation", data.conversation.conversation_id);
      });
    }
  }
};

function handleErr(err = 'None') {
  console.error(`Error occured. Details:`, err);
}

I have tried this and it seems to work properly when changing conversations as shown below.

image

Hope this helps.

1 Like

@Arjun_Paliath

Thanks for your time and consideration I will check it out.

Similar issue: Updating settings does not reflect on app until hard reload the page
If you are in a conversation, then you search for a user/conversation on search box, click on an User, it will open the user and their conversation on People page. Getting the conversation using data method, returns the previous conversation and code is on app activated event.

1 Like