Find Facebook Friends that also registered in the same App.

You must Login before you can answer or comment on any questions.

Hello, Im looking for a way to get a list of facebook users that are also users of my app. i've found this in the Ti docs but i cant seem to get it working.

http://cloud.appcelerator.com/docs/api/v1/social/facebook_friends

Is this example up to date and Do i have to include the cocoafish module.

My Code:

var Cloud = require('ti.cloud');
Titanium.Facebook.appid = "XXX";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
 
// var sdk = new Cocoafish('XXX');  // app key
 
Cloud.sendRequest('social/facebook/search_friends.json', 'GET', null, callback);
 
function callback(data) {
  if(data) {
    if(data.meta) {
      var meta = data.meta;
      if(meta.status == 'ok' && meta.code == 200 && meta.method_name == 'searchFacebookFriends') {
        var user = data.response.users[0];
        Ti.API.info(user);
      }
    }
  }
}
My Error:
Script Error = 'undefined' is not a function (evaluating 'Cloud.sendRequest('social/facebook/search_friends.json', 'GET', null, callback)') at app.js (line 14).

Your Answer

Think you can help? Login to answer this question!