capacitor-plugins
capacitor-plugins copied to clipboard
feat: Support DetectionPattern in Clipboard plugin
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
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).