I'm trying to get user location in Spring Social Facebook:
Facebook fb = ((Facebook) connection.getApi());
Page pg = fb.pageOperations().getPage(fb.userOperations().getUserProfile().getLocation().getId());
The problem is that pg.getLocation()
returns null
.
I also tried with
fb.fetchObject(fb.userOperations().getUserProfile().getLocation().getId(), org.springframework.social.facebook.api.Location.class)
but it does populate only the name, not country or other fields.
Trying on Graph API Explorer /v2.6/112286918797929?fields=id,name,location returns as expected:
{
"id": "112286918797929",
"name": "Sacele",
"location": {
"city": "Sacele",
"country": "Romania",
"latitude": 45.6167,
"longitude": 25.6833
}
}
Is this an issue with Spring Social Facebook?
I'm using Spring Social 1.1.4 and Spring Social Facebook 2.0.3.
I also tried Spring Social for Facebook - get user location, but unfortunately not all the places follow the name convention City, Country and some of them include in the name only the city, not the country too. Plus how can you get the geo-coordinates?