Reputation: 32231
There are few questions about opening a messenger chat with a specif person, and the answer to all of them is not possible.
But the Facebook app does this. When clicking on a friend icon at the top right corner and picking one of the friends, it opens a Messenger-chat with that person.
So how do they do it? I have been trying to find some intent they pass, but I saw nothing.
Upvotes: 1
Views: 2629
Reputation: 1
After doing some research came up with this:
Intent mIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb-messenger://user/" + "myapp"));
startActivity(mIntent);
Hopefully, it would save your time. 😃
Upvotes: 0
Reputation: 21
Try this:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setPackage("com.facebook.orca");
intent.setData(Uri.parse("https://m.me/"+"FacebookId"));
startActivity(intent);
Upvotes: 1