通过Facebook的Andr​​oid图形API检索用户的国家 [英] Retrieve user country through Facebook Android Graph API

查看:160
本文介绍了通过Facebook的Andr​​oid图形API检索用户的国家的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,用户可以使用他的Facebook凭据,我列出了一些他的信息,如位置。不过,我注意到位置的格式是一样的东西的位置:{ID:335457,姓名:市,州}。我想知道,如果有一种方法也检索用户的国家。我看到了Facebook的FQL可以帮助,但是,目前的SDK版本,它是pcated德$ P $。我调用API方法:

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();

我也看了的东西,但没有我的情况下取得成功。我使用的是最新的Facebook Android SDK中提供。

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

感谢您预先的帮助。

推荐答案

位置 字段用户手动设置,并且不neccessarily意味着他是目前在该位置。它的意思是当前的生活的位置。

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.

请参阅

  • https://developers.facebook.com/docs/graph-api/reference/v2.2/user/#fields

通话将

/me?fields=id,location

什么是返回是 PAGE_ID ,对此是可以与

/{page_id}?fields=id,location

位置对象包含一个国家字段。

请参阅

  • https://developers.facebook.com/docs/graph-api/reference/v2.2/page

这篇关于通过Facebook的Andr​​oid图形API检索用户的国家的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆