I want to open facebook messenger by code. How I can get the facebook ID?? I have the facebook SDK on my app and I saved for every user the facebookId but is not the same as I n
You can simply open it like this without an FB ID
Intent intent= new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Hello");
intent.setType("text/plain");
intent.setPackage("com.facebook.orca");
try
{
startActivity(intent);
}
catch (ActivityNotFoundException ex)
{
Toast.makeText(this,
"Oups!Can't open Facebook messenger right now. Please try again later.",
Toast.LENGTH_SHORT).show();
}