On iOS 14, when the user copy/paste content on another app, a notification is displayed with the name of the application where the pasteboard content came from :
Is it possible to get this information programmatically ?
For example, if the user copy a link on Safari and paste it on my app, can the app know the pasteboard content came from Safari ?
I didn't find anything like that on UIPasteboard or UIPasteConfiguration documentation.
It seems there is no API to get the owner
who put the item in pasteboard
.
From documentation:
Pasteboard Owner and Items
The object that last put data onto the pasteboard is referred to as the pasteboard owner. Each piece of data placed onto a pasteboard is considered a pasteboard item. The pasteboard can hold single or multiple items. Apps can place or retrieve as many items as they wish. For example, say a user selection in a view contains both text and an image. The pasteboard lets you copy the text and the image to the pasteboard as separate items. An app reading multiple items from a pasteboard can choose to take only those items that it supports (the text, but not the image, for example).
The addItems method, does not have (or maybe I couldn't find it) any property named owner
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With