(Android Only)
Get clipboard image in base64, this method returns a Promise
, so you can use following code to get clipboard content
async _getContent() {
var content = await Clipboard.getImage();
}
Get clipboard image as JPG in base64, this method returns a Promise
, so you can use following code to get clipboard content
async _getContent() {
var content = await Clipboard.getImageJPG();
}
Get clipboard image as PNG in base64, this method returns a Promise
, so you can use following code to get clipboard content
async _getContent() {
var content = await Clipboard.getImagePNG();
}
Get content of string type, this method returns a Promise
, so you can use following code to get clipboard content
async _getContent() {
var content = await Clipboard.getString();
}
(iOS Only)
Get contents of string array type, this method returns a Promise
, so you can use following code to get clipboard content
async _getContent() {
var content = await Clipboard.getStrings();
}
Returns whether the clipboard has an image or is empty.
This method returns a Promise
, so you can use following code to check clipboard content
async _hasContent() {
var hasContent = await Clipboard.hasImage();
}
(iOS 14+ Only)
Returns whether the clipboard has a Number(UIPasteboardDetectionPatternNumber) content. Can check
if there is a Number content in clipboard without triggering PasteBoard notification for iOS 14+
This method returns a Promise
, so you can use following code to check for Number content in clipboard.
async _hasNumber() {
var hasNumber = await Clipboard.hasNumber();
}
Returns whether the clipboard has content or is empty.
This method returns a Promise
, so you can use following code to get clipboard content
async _hasContent() {
var hasContent = await Clipboard.hasString();
}
(iOS Only)
Returns whether the clipboard has a URL content. Can check
if there is a URL content in clipboard without triggering PasteBoard notification for iOS 14+
This method returns a Promise
, so you can use following code to check for url content in clipboard.
async _hasURL() {
var hasURL = await Clipboard.hasURL();
}
(iOS 14+ Only)
Returns whether the clipboard has a WebURL(UIPasteboardDetectionPatternProbableWebURL) content. Can check
if there is a WebURL content in clipboard without triggering PasteBoard notification for iOS 14+
This method returns a Promise
, so you can use following code to check for WebURL content in clipboard.
async _hasWebURL() {
var hasWebURL = await Clipboard.hasWebURL();
}
(iOS and Android Only) Removes all previously registered listeners and turns off notifications on the native side.
Clipboard.removeAllListeners();
(iOS Only) Set content of base64 image type. You can use following code to set clipboard content
_setContent() {
Clipboard.setImage(...);
}
Set content of string type. You can use following code to set clipboard content
_setContent() {
Clipboard.setString('hello world');
}
Set content of string array type. You can use following code to set clipboard content
_setContent() {
Clipboard.setStrings(['hello world', 'second string']);
}
Generated using TypeDoc
(iOS and Android Only) Adds a listener to get notifications when the clipboard has changed. If this is the first listener, turns on clipboard notifications on the native side. It returns EmitterSubscription where you can call "remove" to remove listener