1

I'm developing an Android application where the user can use his facebook credentials and I list some of his informations like the location. However, I noticed the format of location is something like "location:{id:335457, name: City, State}". I'd like to know if there's a way to also retrieve the user country. I saw the Facebook FQL could help, but, on current SDK version, it is deprecated. My call to the API method:

new Request(session, params, null, HttpMethod.GET,
    new Request.Callback() {
        public void onCompleted(Response response) {
           // treats the response
        }
    }).executeAsync();

I also looked for something, but without success in my case. I'm using the latest Facebook Android SDK available.

Thank you in advance for the help.

1 Answer 1

1

The location field of the user is set manually and does not neccessarily mean that he's currently in that location. It's meant to be the current living location.

See

The call would be

/me?fields=id,location

What's returned is a page_id, for which's location you can query for with

/{page_id}?fields=id,location

The location object contains a country field.

See

3
  • Hi. Thank you for the answer. I'm almost getting the information I need, but, when trying to call the /page_id I receive this error: "Some of the aliases you requested do not exist: {page_id}". Would you know why this happens? I'm looking for something, but without success so far.
    – Hime
    Dec 9, 2014 at 18:03
  • It's all in my answer! For sure you Need to replace {page_id} with the id you got first request
    – Tobi
    Dec 9, 2014 at 18:27
  • Oh, I see. Sorry for that :~ So, I tried it here and it's working. Thank you. However, the field country is not available. I only get the latitude and longitude informations on Location object. But, it is going to help me anyway. Once again, thank you.
    – Hime
    Dec 9, 2014 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.