Is there a way to retrieve language-specific name for a user, using Graph API?
I am finding answer of this question. And finally, I got a solution for this.
step 1. First, request below api
/v2.4/me?fields=id,name,locale
then, you received locale information of the user.
step 2. Now, request below api
/v2.4/me?fields=id,name?locale="locale received in step 1"
If you use android facebook sdk like me, then write code like below.
Bundle bundle = new Bundle();
bundle.putString("fields", "id,name,locale");
//bundle.putString("locale", "ko_KR");
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me",
bundle,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.d(TAG, "response -> " + response.getRawResponse());
}
}
).executeAsync();
"me" can be converted into "". I tested in the graph api(v2.4). Thank you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With