How to open a chat window of Messenger for Facebook using the application identifier in Android

I can get the user id in the application with a graph-api in my application. Then, how to open the Messenger chat window on Facebook using the application id in Android.

We can open the messenger facebook chat window using global-facebook-id (using intent and uri).

Uri uri = Uri.parse("fb-messenger://user/");
uri = ContentUris.withAppendedId(uri, Long.parseLong(peopleId));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

But it is not possible to get the global-facebook id using app-scoped-id.

Then, I want to know how to open the Messenger chat window for Facebook using only the application identifier. I don’t need to send a personal message, only opening is all I need.

Thanks for your reading!

+4
1

. , Facebook Messenger, - ...

+3

Source: https://habr.com/ru/post/1614073/


All Articles