Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created October 3, 2011 17:06

Revisions

  1. jonalter created this gist Oct 3, 2011.
    7 changes: 7 additions & 0 deletions get_number_of_likes.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Titanium.Facebook.requestWithGraphPath('OBJECT_ID', {}, 'GET', function(e) {
    if (e.success) {
    alert(e.result);
    } else {
    return -1;
    }
    });
    13 changes: 13 additions & 0 deletions like.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    // 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');
    }
    }
    });