I made "COPY" button in my game.
When the button is clicked, specific texts is copied to user's clipboard.
I added this JS function below.
It works perfectly in PC Web (Chrome) but it didn't work in iOS Safari on my phone/ipad :(
The alert appears well, but there's nothing in the clipboard.
I don't know why it dosen't work...... T_T
var tmpTextarea = document.createElement('textarea');
tmpTextarea.value = 'text to copy';
document.body.appendChild(tmpTextarea);
tmpTextarea.select();
tmpTextarea.setSelectionRange(0, 9999);
document.execCommand('copy');
document.body.removeChild(tmpTextarea);
alert('copy completed');