0

My Firebase app is trying to link to a user's Facebook Home page like this, in order to send a message to the user:

        reachOut.setOnClickListener(new View.OnClickListener(){
        public void onClick(View view) {
            // Navigate to person's Facebook page to send a message.
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://facebook.com/" + idArray[selectedPosition]));
            startActivity(intent);
        }
    });

idArray[] contains a list of app-scoped Facebook IDs. This works fine for a number of users, but not for others. I asked one person if he was blocking access to his page, but he said he was not. Also, from what I read in the Facebook docs, app users cannot turn off access to their Home pages:

User Control Facebook Login allows a person to grant only a subset of permissions that you ask for to your app, except for public profile, which is always required. This is available as a separate screen in the login dialog when you ask for permissions. Your app should handle the case where someone had declined to grant your app one of the permissions you requested.

I also tried sending a message with Facebook Messenger, via the following:

    reachOut.setOnClickListener(new View.OnClickListener(){
        public void onClick(View view) {
            // Navigate to person's Facebook page to send a message.
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb-messenger://user/" + idArray[selectedPosition]));
            startActivity(intent);
        }
    });

but this just displays "No messages in this conversation" followed by an error popup when I try to send a message.

Anyone have an idea what's going on or can you suggest an alternative approach?

FractalBob
  • 3,225
  • 4
  • 29
  • 40
  • You’re not supposed to be able to do link to a user’s profile via their app-scoped user id any more. You can only request a specific link with a token, that will work for friends of the user, and for a limited time. Check the linked duplicate for details. – CBroe Mar 09 '20 at 07:26
  • I had tried requesting the user_link permission previously, but then GraphRequest.newMeRequest() returned a null object. I'll repost that as a separate issue. – FractalBob Mar 10 '20 at 08:21

0 Answers0