Created
February 15, 2011 20:02
-
-
Save billdawson/828123 to your computer and use it in GitHub Desktop.
Using Titanium.Facebook.requestWithGraphPath to publish to a Facebook Stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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