(BUG) Chatbox maximize() function bug

The Wix Chatbox .maximize() function is bugged on mobile devices.

As you can see that the Chatbox maximizes correctly on desktop but on mobile devices it does not. If you try to manually open the chatbox the window is bugged and the icon to close the chatbox does not appear in frame.

The relevant code on the page is given below the video.

import wixLocation from 'wix-location';
import {session} from 'wix-storage';

$w.onReady(function () {
    initiateChat();
    let value = wixLocation.query["source"]
    if(value === 'form') {
      $w("#mainText").text = 'Message Received';
      $w("#mainText").show();
      $w("#supportTxt").show();
      $w("#image").show();
      $w("#loader").hide();
   } else if(value === 'payment') {
     $w("#mainText").text = 'Payment Successful';
     $w("#mainText").show();
     $w("#supportTxt").show();
     $w("#image").show();
     $w("#loader").hide();
   } else {
     $w("#mainText").text = 'Nothing to see here!';
     $w("#mainText").show();
     $w("#loader").hide();
   }
});

function initiateChat() {
   let project = session.getItem("project");
   if(project) {
     sendMsg(project);
   } else {
     console.log('None');
   }
}

function sendMsg(project) {
   let messageInfo = {
      "messageText": 'Dude Lemon Project Contact Form Submitted For ' + String(project)
   };
   $w("#wixChat1").sendMessage(messageInfo)
   .then( () => {
      max();
   })
   .catch((err) => {
      console.log(err);
   });
}

function max() {
   $w("#wixChat1").maximize()
   .then(() => {
      console.log("Done with maximize");
   })
   .catch( (err) => {
      console.log(err);
   });
}

Shan,

Have a read of the previous posts here as there was an issue with the Wix Chatbox Backend API and the maximize function that was being addressed in Dec 2019, so they may have fixed it for desktop only and not for mobile.

Are you able to test it on a tablet device to see if it works there too and see if it is just mobile that is affected?

https://www.wix.com/corvid/forum/community-discussion/open-chat-widget-when-button-is-clicked
https://www.wix.com/corvid/forum/community-discussion/how-to-access-wix-chat-chatbox-api-events

Both of them work if you test them on a live published site and not through the preview.

Adding @erez-paperny into this chat so that he can have a look at it for you. :crossed_fingers:

So now I have the same issue. I there anything new on this matter please?
Thanks,
Tom

Yup I’ve faced this problem before, gone through a few other discussions threads. Only managed to make it work on desktop. All the other threads, don’t address the mobile issue, it’s only solved for desktop.

On mobile it’s buggy, it doesn’t maximize the chatbox when the link button is clicked. And if I click on the chatbox directly after that, I am unable to close the chat window. I have to close the whole tab and then reopen the page.

Any update on this will be much appreciated. :blush: