How can I get access to the iPhone clipboard whilst using PhoneGap? I cannot see support in their docs so wonder if there is another way I can gain access?
Asked
Active
Viewed 3,310 times
3
-
You can do it with Javascript, with or without JQuery. See http://stackoverflow.com/questions/3475293/copy-and-paste-clipboard-in-javascript-or-jquery – Diego Mar 25 '12 at 20:08
-
Thanks for the answer but this seems to be a Mozilla only solution and the jQuery plugin requires flash, which isn't on the iPhone – Chris Mar 25 '12 at 20:10
3 Answers
6
There's a ClipBoard plugin that you can try: https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/ClipboardPlugin
Note that this plugin supports copying and pasting only text and no other data types right now.

Vicenç Gascó
- 1,326
- 2
- 13
- 21
-
1Thanks - I had literally just found this as you posted. P.s. any idea how to extend this for images? – Chris Mar 25 '12 at 20:29
-
2U're welcome. I'm not sure how to extend it for images, but if you have access to objective-c code, just use the `NSPasteboard* pasteBoard = [NSPasteboard generalPasteboard];`, then you can get the content with: `image = [pasteBoard dataForType:NSTIFFPboardType];`. – Vicenç Gascó Mar 25 '12 at 20:36
-
2
-
1
Link does not work. I found this other question more useful