0

I am working on an ActionScript Air Mobile project in FlashDevelop using the FacebookMobile API to get and sort users' friends lists. I'm currently using FacebookMobile.batchRequest() to get the information I want and it works fine.

Working code:

var installedBatch:Batch = new Batch();
installedBatch.add("me/friends?fields=installed,name", handleFriendsList);
FacebookMobile.batchRequest(installedBatch);

The resulting JSON object passed to handleFriendsList() contains a list of the user's friends. Each friend contains an id and a name field. Only friends who have the app installed contain the installed field which is set to "true". I would like to condense this down to one line using FacebookMobile.api(), but when I try I get and error.

Attempted code:

FacebookMobile.api("me/friends?fields=installed,name", handleFriendsList);

This should result in the same JSON object being passed to handleFriendsList(), but instead I get an error complaining that I don't have an active access token.

Error:

message = "An active access token must be used to query information about the 
current user."

The odd thing is that I only get this error with FacebookMobile.api() and it only happens when I ask for the installed and name fields. FacebookMobile.api() works just fine when I just ask for "me/friends" without specifying the installed and name fields.

Does anyone know why this is happening?

Macros185
  • 231
  • 1
  • 3
  • 9

1 Answers1

1

try making the request using the params argument.

FacebookMobile.api("me/friends", handleFriendsList, {fields:"installed,name"});
jhinkley
  • 668
  • 4
  • 10