Skip to main content
Version: 0.74

๐Ÿšง Clipboard

Removed. Use one of the community packages instead.

Clipboard gives you an interface for setting and getting content from Clipboard on both Android and iOS


Exampleโ€‹

Reference

Methodsโ€‹

getString()โ€‹

static getString()

Get content of string type, this method returns a Promise, so you can use following code to get clipboard content

async _getContent() {
const content = await Clipboard.getString();
}

setString()โ€‹

static setString(content)

Set content of string type. You can use following code to set clipboard content

_setContent() {
Clipboard.setString('hello world');
}

Parameters:

NameTypeRequiredDescription
contentstringYesThe content to be stored in the clipboard

Notice

Be careful when you're trying to copy to clipboard any data except string and number, some data need additional stringification. For example, if you will try to copy array - Android will raise an exception, but iOS will not.