capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

feat: Support DetectionPattern in Clipboard plugin

Open bolchowka opened this issue 4 years ago • 1 comments

Feature Request

Plugin

@capacitor/clipboard

Description

iOS 14 introduced an alert that indicates an app reads clipboard contents. It is possible to check clipboard content type without showing an alert using DetectionPattern API.

It would be great if @capacitor/clipboard plugin supported this API.

Platform(s)

iOS

Preferred Solution

A quick proposal based on DetectionPattern API.

const result: boolean = await Clipboard.detectPattern(DetectionPattern.Number);
const result: boolean = await Clipboard.detectPattern(DetectionPattern.ProbableWebSearch);
const result: boolean = await Clipboard.detectPattern(DetectionPattern.ProbableWebURL);

Alternatives

N/A

Additional Context

N/A

bolchowka avatar May 13 '21 09:05 bolchowka

Just idea: It could also have callback to call when pattern matched with correct type, so e.g. when detecting image will not read its URL (what current code does - #1083).

iBobik avatar Jul 15 '22 14:07 iBobik