0
votes

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.

1
Please have a look on this question, it might help you. stackoverflow.com/questions/4810803/… - Kristo
@Kristo1990 thanks I tested again and worked. Will post the answere here for reference. - roy_lennon
@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
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

1 Answers

1
votes

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);