Android 通过Facebook应用程序打开Facebook页面

Android 通过Facebook应用程序打开Facebook页面,android,facebook,android-intent,Android,Facebook,Android Intent,如何使用内置的Facebook应用程序打开Facebook页面?完全是页面,而不是个人资料,因为fb://个人资料工作正常 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/page_id"))); 似乎fb://page不起作用,因为它只是打开了提要。fb://page/{id}是一种方法: final String url = "fb://page/" + facebookID Intent facebook

如何使用内置的Facebook应用程序打开Facebook页面?完全是页面,而不是个人资料,因为fb://个人资料工作正常

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/page_id")));
似乎fb://page不起作用,因为它只是打开了提要。

fb://page/{id}是一种方法:

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);
你确定你使用的是Facebook页面的ID号而不是用户名吗

我的意思是,例如,如果你想打开Facebook本身的Facebook页面(即),你必须使用:

fb://page/20531316728
因为205316728是Facebook页面的ID(而Facebook是用户名

如果您不知道Facebook页面的ID,您可以通过以下方式检索:

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

确保正确使用页面的页面id

Intent intent = new Intent(Intent.ACTION_VIEW, Uri
                                .parse("fb://page/YOUR PAGE ID"));
                        startActivity(intent);
我认为你应该使用

而不是fb://page/或fb://profile或其他东西。 我希望这会有帮助


这太无聊了,你需要获取id,这意味着,在某些应用程序中,if需要另一个api调用,并且需要延迟。谢谢!如果要打开“note”/“notes”页面,可以将“page”替换为“note”,如下所示:final String url=“fb://note/”+facebookNoteID;