fb:// profile / {userid}似乎无法正常工作

时间:2015-01-28 03:40:04

标签: android facebook android-intent android-facebook

我尝试使用特定页面启动Facebook应用程序,它正在使用早期版本的FB APP,但新版本为25.0.0.19.30。此功能无效,uri.parse(" fb:// profile / {userid}")的意图将我带到内容不可用的页面。

  • 这是来自facebook的安全更新吗。

以特定用户页面启动应用的任何其他方式。

1 个答案:

答案 0 :(得分:11)

您应该使用fb:// page / {id}

从这里了解到:http://binwaheed.blogspot.com.ar/2014/06/android-open-facebook-official-app-from.html

如果您需要回退到浏览器,您应该实现以下内容:

Intent intent = null;
try {
    // get the Facebook app if possible
    this.getPackageManager().getPackageInfo("com.facebook.katana", 0);
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/{id}"));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
    // no Facebook app, revert to browser
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://facebook.com/PROFILENAME"));
}
this.startActivity(intent);