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);
});
}