Open Facebook page via Facebook app

2019-06-24 00:08发布

问题:

How can I open Facebook page using insalled Facebook app? Exactly page, not profile, because fb://profile works fine.

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/page_id")));

Seems like fb://page isn't working, because it's just opens feed.

回答1:

fb://page/{id} is the way to go:

final String url = "fb://page/" + facebookID
Intent facebookAppIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
facebookAppIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(facebookAppIntent);

Are you sure you are using the ID number of your Facebook page and NOT the username?

What I mean is that if, for example, you want to open the Facebook page of Facebook itself (i.e. https://www.facebook.com/facebook) you have to use:

fb://page/20531316728

Since 20531316728 is the ID of the Facebook page (while facebook is the username).

If you don't know the ID of your Facebook page, you can retrieve it opening:

https://graph.facebook.com/{username}


回答2:

Make Sure That You are Using the page id of your page correctly

Intent intent = new Intent(Intent.ACTION_VIEW, Uri
                                .parse("fb://page/YOUR PAGE ID"));
                        startActivity(intent);


回答3:

i think u should use

https://www.facebook.com/ instead of fb://page/ or fb://profile or something. I hope it's helpful!