Search code examples
facebookbotsfacebook-messenger

Retrieve location from Facebook Messenger Bot automatically (without user sending location actively)


I was just researching the facebook Messenger Bot and it seems a quite vital feature is not supported by the messenger. Actually I found quite some tutorials how to read the location out of a users post when he sends his location: Facebook Messenger Chatbot how do I collect the users geo location that they send?

However, is it not possible to get the location from the user without any additional interaction with the user? Like Apps (i.e. Tinder) know exactly where you are even when not using the service.

Is the messenger not streaming the users location? I was just like thinking: If a user is coming closer to an airport, ask him to do this and that. How I see it I would constantly need to ask the user where he currently is and to send me a location of his position.

Or is there anything the user might enable to support the function?

Thanks for your help!


Solution

  • The user's location is not automatically shared with the Bot. As you noted, the user can manually share their location.

    Some information can be obtained from the User Profile but not an exact location.

    I have implemented the locale feature in my Bot. You can see the source code here, look for the callGetLocalApi function in app.js

    You can see more details about implementation in my article Facebook Bots for Fun and Profit.