问题
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