Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created October 3, 2011 17:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonalter/1259610 to your computer and use it in GitHub Desktop.
Save jonalter/1259610 to your computer and use it in GitHub Desktop.
Facebook: likes
Titanium.Facebook.requestWithGraphPath('OBJECT_ID', {}, 'GET', function(e) {
if (e.success) {
alert(e.result);
} else {
return -1;
}
});
// facebook's documentation http://developers.facebook.com/docs/reference/api/
// Change OBJECT_ID to an actual object id
Titanium.Facebook.requestWithGraphPath('OBJECT_ID/likes', {}, 'POST', function(e) {
if (e.success) {
alert('Success! From FB: ' + e.result);
} else {
if (e.error) {
alert(e.error);
} else {
alert('Unkown result');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment