I'm retrieving user's Facebook id using AccessToken.getCurrentAccessToken.getUserId()
and saving it in FirebaseDatabase
.
Then I'm retrieving it and populating several CardView
s using the data. Each card gets an ID and there's a button on card which when pressed should open the Facebook Messenger chathead associated with that ID.
I tried opening the chathead using this code:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb-messenger://user/"+fbID));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
Though it is opening the chathead but not of the user whose ID was associated with that card. It opens the chathead for some anonymous Facebook User
.
I searched internet and find out that now Facebook allows to have a different id which is called app scoped user id
. When I tried to get the id from https://findmyfbid.com, I got the original ID.
The problem is that with the app scoped user id
, we can't open the specific chathead anymore but with the ID fetched from findmyfbid.com, the chathead for that specific user gets opened.
So, is it completely impossible now to open chathead of various users or is there any other way to do this.
Please let me know if there is another way to send message to that user using his/her Facebook ID.