0

Is there a way to open a Facebook user profile with the Facebook app from another app?

I get this link from Graph Api: https://www.facebook.com/app_scoped_user_id/1234567/ that is the link to the user profile and I will like to open the profile using the Facebook app.

If I create an intent with ACTION_VIEW and that URL it opens Facebook in the browser.

Thanks!

I saw other options but they are outdated. I'm using v2.4 from Graph API.

roy_lennon
  • 807
  • 2
  • 9
  • 16
  • Please have a look on this question, it might help you. http://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app – Kristo Jan 05 '16 at 20:39
  • @Kristo1990 thanks I tested again and worked. Will post the answere here for reference. – roy_lennon Jan 05 '16 at 21:48
  • @Kristo1990 it is working, but it only works if the user is already your friend. What if I want to see the profile of a user that is not my friend, because I'd like to send a request to him? – roy_lennon Jan 05 '16 at 21:52
  • Hmm as people say in that topic it opens the profile i think in a browser if the fbid is not one of your friends. let me check around if I find anything I will let you know. – Kristo Jan 05 '16 at 22:20

1 Answers1

1

I used this code and finally it worked. Based on the post suggested by @Kristo1990.

String uri = "fb://profile/12345678";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);
roy_lennon
  • 807
  • 2
  • 9
  • 16