Problem Description:
I am encountering an issue with embedding the iframe of the Promium AI chatbot on iOS devices (iPhone and iPad). The chat widget works perfectly fine on various devices including Mac, Linux, Windows, and Android, but fails to send messages on iOS systems.
The iframe is generated by the script for embedding the Promium AI chatbot, accessible at [https://promium-embed.s3.amazonaws.com/promium_embed/index.html][1].
Possible Causes:
I suspect that this issue might be related to CORS (Cross-Origin Resource Sharing) or SSL certificate problems. However, after checking our servers thoroughly, everything seems to be in order, and no errors are reported.
Technologies Used:
Backend: Flask
Frontend: HTML, JavaScript, CSS
Request for Community Assistance:
I would like to ask the Stack Overflow community if anyone has encountered similar issues with embedding iframes, on iOS devices, and if so, how they resolved it.
Any insights, suggestions, or experiences shared would be greatly appreciated.
Thank you in advance for your assistance.
function botResponse() {
//ENABLE
enableloader()
fetch('/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'referer': window.location.href
},
body: `q=${encodeURIComponent(msgerInput.value)}&ip=${encodeURIComponent(ipAddress)}`
})
.then(response => {
if (response.headers.get('content-type').includes('application/json')) {
return response.json();
} else {
return response.text(); // Tratta il corpo della risposta come testo
}
})
.then(AIreply => {
console.log('%cReply:', 'font-weight: bold');
console.log(AIreply.message);
console.log('%cSource documents:', 'font-weight: bold');
console.log(AIreply.source_documents);
var botMessage = AIreply.message;
if(botMessage=="<p>Agent stopped due to iteration limit or time limit.</p>"){
botMessage="Please redefine the question."
}
appendMessage(BOT_NAME, BOT_IMG, "left", botMessage);
//DISABLE
disableloader()
msgerInput.value = "";
})
.catch(error => {
console.error(error);
appendMessage(BOT_NAME, BOT_IMG, "left", "Sorry an error occurred, <a href='#' onClick='window.location.reload(true);'>Click here to refresh</a>");
msgerInput.value = "";
});
}