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 foruser_profile
permission to get user id (Messenger Permissions)