How can I launch facebook messenger with to enable user to user chat

走远了吗. 提交于 2020-01-17 08:38:11

问题


Users log into my app through the facebook sdk. If one user clicks on another user I'd like to enable them to chat via facebook messenger. I can launch messenger from my app, but is there a way to launch into the chat screen with a specific user.


回答1:


You can open a conversation in Messenger with deep links:

  • http://m.me/{user_name} <- this is official link for Messenger. You'll need to ask user for his Messenger's username.
  • fb-messenger://user/{user_id} <- this link is not documented, so it can break any time (Deep linking). user_id probably is the Facebook User Id, so it will be easier to obtain, however you'll need to ask for user_profile permission to get user id (Messenger Permissions)


来源:https://stackoverflow.com/questions/47255784/how-can-i-launch-facebook-messenger-with-to-enable-user-to-user-chat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!