I have a short Problem. I want to add a text to the clipboard on my iOS Device when I press a Button which use a ajax request to get the data into the clipboard.
With the Browser on my Desktop and my Android device it works very well but with my iOS Device a get an Issue.
$.ajax({
type: "GET",
url: "missing_string.php",
data: getAttributes($(this)),
success: function(data) {
if (navigator.clipboard) {
navigator.clipboard.writeText(data)
.then(() => {
alert("SUCCESS");
})
.catch(err => {
alert(err);
console.log('Something went wrong', err);
});
So I get following error message:
NotAllowedError: the request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
How can I get my Text to the clipboard? I use iOS 13.5 and 13.4 should support the Clipboard API.