Facebook Graph API - how to get user country?

后端 未结 10 1638
心在旅途
心在旅途 2020-11-30 02:56

I\'m developing a Facebook application using their Graph API. I have previously developed an app using the deprecated REST API.

I\'ve come across a problem in that

10条回答
  •  情歌与酒
    2020-11-30 03:18

    One solution I have found, which is merely a workaround, is to use the GeoNames API - http://www.geonames.org/export/web-services.html

    Using something like:

    http://api.geonames.org/search?q=houston%2C%20texas&featureClass=P&username=myusername
    

    Returns results in an xml object, with the country as part of the data.

    I'm not particularly happy with this as a solution however, as it adds an unnecessary layer of complications on to my application - plus requests to this free services are limited to 2000 per hour and 30,000 per day.

提交回复
热议问题