Skip to content

Instantly share code, notes, and snippets.

@billdawson
Created February 15, 2011 20:02
Show Gist options
  • Save billdawson/828123 to your computer and use it in GitHub Desktop.
Save billdawson/828123 to your computer and use it in GitHub Desktop.
Using Titanium.Facebook.requestWithGraphPath to publish to a Facebook Stream
function showFBResult(eventData) {
if (eventData.success) {
alert("Success! From FB: " + eventData.result);
} else {
if (eventData.error) {
alert(eventData.error);
} else {
alert("Unknown result");
}
}
}
var data = {
link: "https://developer.mozilla.org/en/JavaScript",
name: "Best online Javascript reference",
message: "Use Mozilla's online Javascript reference",
caption: "MDN Javascript Reference",
picture: "https://developer.mozilla.org/media/img/mdn-logo.png",
description: "This section is dedicated to JavaScript..."
};
Titanium.Facebook.requestWithGraphPath('me/feed', data, 'POST', showFBResult);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment