相关疑难解决方法(0)

从Android应用程序打开Facebook页面(在facebook版本> v11)

我曾经使用下面的代码从我的应用程序打开我的Facebook页面,但这不再起作用于2014年6月21日发布的facebook v11.0.0.11.23,任何想法如何在新的Facebook应用程序中打开页面?要注意它现在打开Facebook应用程序,但没有打开指定页面,它曾经在最新更新之前工作正常

public void openFacebookPage() {
    Intent intent = null;
    try {
        context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
        intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<id here>"));
        //tried this also
        //intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/<id here>"));
    } catch (Exception e) {
        intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<name here>"));
    }
    context.startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)

android facebook

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

facebook ×1