Facebook Graph API - how to get user country?

后端 未结 10 1646
心在旅途
心在旅途 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:13

    use the official Facebook Graph API /me?fields=hometown it will return you e.g. "Prague, Czech Republic"

    I believe you can explode the string by needle ',' and the last element should be the country

提交回复
热议问题