简体   繁体   中英

Facebook Graph API Gender

Hi I have problem with Facebook Graph API. I'm using it in cordova with this plugin: https://github.com/jeduan/cordova-plugin-facebook4 (I think is not important)

The main problem is value gender. When system language is English I get following value:

gender: "male"

but when my system language is Czech I get following value:

gender: "muž"

and this is problem for me because I expecting for future work "male" or "female"

does anyone now how to figure it out and get always english?

Thanks for any answer

You just have to add the locale to the API call, it would be like this for english:

/me?fields=gender&locale=en_US

Or with the Cordova plugin:

facebookConnectPlugin.api('/me?fields=gender&locale=en_US', ...)

See this for more information about how to use the Graph API. Written under "Modifying API Requests":

locale
Used if your app needs the ability to retrieve localized content in the language of a particular locale (when available).

So try to set the locale parameter to english.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM