how to start android facebook app chat from another app

落花浮王杯 提交于 2019-12-30 05:21:05

问题


I've seen other topics like this: launch facebook app from other app and tried some of the URIs listed there, but I can't figure out how to start the facebook chat with a specific friend.

Is there an official page that describes the IntentUriHandler and all the allowed URIs with their params?

Thanks, Lorenzo


回答1:


found it here: https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links#format

http://m.me/{#user_id}

you can use this URI to open messaging with a friend with known id.

You can start the intent like below

startActivity(new Intent(android.action.VIEW, "http://m.me/{#user_id}"));



回答2:


startActivity(new Intent(Intent.ACTION_VIEW,
              Uri.parse("fb://messaging/" + userId)));


来源:https://stackoverflow.com/questions/8971731/how-to-start-android-facebook-app-chat-from-another-app

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