Note that there are some explanatory texts on larger screens.

plurals
  1. POPosting image to FaceBook wall from iPhone camera roll with PhoneGap
    text
    copied!<p>I am using <strong>PhoneGap</strong> to publish an <strong>image</strong> to a <strong>FaceBook wall</strong> from an <strong>iPhone</strong>.</p> <p>I am able to log in a FaceBook account and publish a HOSTED image (<code>http://www.mysite.com/my_image.jpg</code>) but not an image from the iPhone.</p> <p>Here is the script to post to FB:</p> <pre><code>function fbPost() { $.ajax({ type: 'POST', url: "https://graph.facebook.com/me/feed", data: { message: "&lt;FACEBOOK MESSAGE&gt;", PICTURE: "&lt;IMAGE URL&gt;", name: "&lt;TITLE OF POST&gt;", link: "&lt;LINK TO APP&gt;", caption: "&lt;SHOWN BELOW TITLE&gt;", description: "&lt;SHOWN BELOW CAPTION&gt;", access_token: access_token, format: "json" }, success: function (data) { navigator.notification.alert("success!", null, "Thanks!") }, }, dataType: "json", timeout: 10000 }) } </code></pre> <p>Here is the code to get an image from the iPhone (camera roll or album):</p> <pre><code>navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI }); function onSuccess(imageURI) { var image = document.getElementById('myImage'); image.src = imageURI; } </code></pre> <p>(<a href="http://docs.phonegap.com/phonegap_camera_camera.md.html" rel="nofollow">http://docs.phonegap.com/phonegap_camera_camera.md.html</a>).</p> <p>When I use an image from the iPhone, the URI of the image is something like: <code>file:///var/mobile/Applications/..../Documents/tmp/photo_001.jpg</code></p> <p>Again, I am able to publish an image when I specify a hosted (<code>http://...</code>) image, but not when it's an image from the iPhone. </p> <p>I would greatly apreciate any help.</p> <p>Thank you.</p> <p>Rob</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload