Clipboard writing does not work in mobile browsers

Hi, I am writing a code like this and I want to copy value "ReferralCode in the clipboard. It works well when I run the game on a laptop, but it does not work when I use a mobile phone. What can I do ?!


The latest version was tested on mobile devices. Make sure you have an up-to-date version of the extension.

i use clipboard version 1.0.0… but it dosent work yet

ps: game was builded WEB mode and published on my own server

Tested on a web preview with the latest version of chrome Android, it works perfectly fine. Your browser probably simply doesn’t allow accessing the clipboard, which is not a GDevelop issue.

Also note that no browser will allow accessing the clipboard if your server doesn’t meet the criteria of a secure context.

I installed the latest Clipboard extension. It is not working in Safari, both in mac and iphone.
It shows error when writing to clipboard as following.

[Error] Error while writing clipboard: – NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. — gdjs-evtsext__clipboard__writetext-func.js:26

Reference: New WebKit Features in Safari 13.1 | WebKit

WebKit brings the Async Clipboard API to this release of Safari. It provides access to the system clipboard and clipboard operations while keeping the webpage responsive. This API is much more flexible than DataTransfer, allowing developers to write multiple items with multiple types per item. Additionally, it brings programmatic paste to all websites on macOS and iOS.

The implementation is available through the navigator.clipboard API which must be called within user gesture event handlers like pointerdown or pointerup, and only works for content served in a secure context (e.g. https://). Instead of a permissions-based model for reading from the clipboard, a native UI is displayed when the page calls into the clipboard API; the clipboard can only be accessed if the user then explicitly interacts with the platform UI.