1

I want to open a person's Facebook profile in the native Android app with a given numerical user ID. Note that I am not referring to the vanity URL like www.facebook.com/person.name.7.

I've tried seemingly every URL scheme including the following with no luck:
fb://page/426253597411507
fb://profile/426253597411507
fb://facewebmodal/f?href=https://www.facebook.com/426253597411507
https://www.facebook.com/n/?426253597411507

Does anyone know a URL scheme that currently works? Or a way to get the vanity URL from the profile ID?

Eric B.
  • 673
  • 11
  • 16

2 Answers2

1

Try launching an explicit intent per this answer

Intent intent = null;
try {
    // get the Facebook app if possible
    this.getPackageManager().getPackageInfo("com.facebook.katana", 0);
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/{id}"));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
    // no Facebook app, revert to browser
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://facebook.com/PROFILENAME"));
}
this.startActivity(intent);
Community
  • 1
  • 1
kira_codes
  • 1,457
  • 13
  • 38
  • 1
    Thanks for the answer, but no luck. `fb://page/{id}` opens the app with an empty profile, and `fb://profile/{id}` opens the app with a "Content not available" error message – Eric B. Sep 07 '16 at 22:09
0

In my case i am loading users profile picture using below code hope may be it will help to you.

Picasso.with(Main.this).load("https://graph.facebook.com/" + facebookuserid
                                + "/picture?type=small").resize(80, 80)
                        .into(fbpicImageView);