I need to copy an URL (in fact an URL of an image) to the clipboard inside my app then paste it in another app (iMessenger, but the other app is not important, right now).
I can’t use the usual setData, like this
Clipboard.generalClipboard.setData(ClipboardFormats.URL_FORMAT, “http://myimage.com/image.jpg”);
because only theses threes format at supported by ClipboardFormats:
public var HTML_FORMAT = "air:html";
public var RICH_TEXT_FORMAT = "air:rtf";
public var TEXT_FORMAT = "air:text";
I know that more format are available “natively”, but I’m not quite sure if we can access them? Anybody had any luck with this?
Yes. with the text mode the clipboard works fine, but iOS don’t handle “text” clipboard and “url” clipboard the same way. So in text mode, it will paste the URL as regular text, but in “url” mode it will try to paste the content of the URL, in my case an image.
I have seen an implementation of the titanium api in haxe that seem to be handling more advanced copy mode, but i haven’t been able to import it correctly in my project.
Basically, what i want to do would be something like:
Clipboard.generalClipboard.setData(“text/uri-list”, “http://myimage.com/image.jpg”);
Not quite sure if this is not implemented or not permitted outside native app. In native the format is “text/uri-list”.