0

Developing a web application using Facebook API JavaScript SDK I'm trying to store some application settings on the Facebook, so it would be possible to load the settings even if the user has changed a browser.

There are data.getCookies and data.setCookies methods described on the Facebook API documentation but both of them don't work. They return

{
  error_code: "3",
  error_msg: "Unknown method"
}

Here is the request I'm sending:

FB.api(
  {
    method: 'data.getCookies'
  },
  function(response) {
    console.log( response )
  }
);

All other methods from the documentation work fine, for instance:

FB.api(
  {
    method: 'friends.get'
  },
  function(response) {
    console.log( response )
  }
);

returns an array with uids.

Are data.* methods deprecated? Is there a workaround?

Daniel J F
  • 1,054
  • 2
  • 15
  • 29

1 Answers1

0

There are data.getCookies and data.setCookies methods described on the Facebook API documentation

Where exactly?

but both of them don't work.

Facebook has recently turned some methods in the SDK, that before where publicly available, into “private” ones.

Developers should only use the methods described here: https://developers.facebook.com/docs/reference/javascript/

Everything else is not guaranteed to work in any particular way, nor guaranteed to continue working if it should do so right now by pure chance.

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • JavaScript SDK documentation says SDK "includes all of the features of the REST API" and REST API has data.getCookies and data.setCookies. The problem if they are depricated is that there is no alternative for them. – Daniel J F Sep 28 '12 at 14:22
  • 1
    That may be an old comment, not updated yet. Fact is, the Rest API has been deprecated for quite some time now, and using any of it’s features in a new build app is not a good idea. And maybe Facebook has given up on the possibility to store data on their side via cookies altogether. You could store it on your side, and relate it to the user once the log in to your app. – CBroe Sep 29 '12 at 15:19