Does anyone have experience with: cordova.plugins.clipboard?
Do you actually need to use a plugin here? It can usually be done using JavaScript:
navigator.clipboard.writeText(data).then(
function () {
console.log("Async: Copying to clipboard was successful!");
},
function (err) {
console.error("Async: Could not copy text: ", err);
},
);
It works for Android but not for IOS… IOS is particular about a “gesture” to copy to the clipboard… I really don’t want to use a plugin, but… I’m open to other ideas… this seems to be an “issue” with IOS/ Safari.
I’m using the exact code you show here… IOS is different from ANDROID in this regard..
Everything else is PERFECT..
TY
iOS should work, so long as it is called from a gesture, such as a button saying “Copy to Clipboard”. This is for security, to prevent apps from silently writing to the clipboard without involvement by the user.
If that does not work for you, you may need to use a plugin. Do you mean cordova-clipboard?
Yes… Is there anything negative relating to that plugin?
Thank you…
Not that I would expect - it has over 7000 downloads in the last week, so it seems to be widely used.
Thank you I appreciate your explanation