Reputation: 977
We have a few bots on fb messenger, and facebook sends us the user's sender id that is connected to our page and not the actual fb user id. When we try to fetch user profile with the graph api, the time zone comes incorrectly. Rest all details like user name, gender and profile picture comes correctly, so the access token and sender id are correct.
All the users' timezones come as IST (5.5), where we operate from. So I guess it has something to do with how the sender id is created, or fb is sending the time zone of our page and not the user profile. Does anyone else face similar problem?
Upvotes: 0
Views: 2820
Reputation: 66
It worked for me, perhaps most of your users were in the same timezone as you?
Just to make sure we're on the same page with the get request... You can find Facebook's User profile reference here. https://developers.facebook.com/docs/messenger-platform/user-profile
You'll have to make a get request to this url with the user's id and your app's token.
"https://graph.facebook.com/v2.6/USER_ID?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=PAGE_ACCESS_TOKEN"
Upvotes: 2