我尝试使用特定页面启动 facebook 应用程序,它使用早期版本的 FB 应用程序,但使用新版本 25.0.0.19.30。此功能不起作用,uri.parse("fb://profile/{userid}") 的 Intent 将我带到内容不可用页面。
- 它是来自 Facebook 的安全更新吗。
通过特定用户页面启动应用程序的任何其他方式。
最佳答案
你应该使用 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);
关于android - 面子书 ://profile/{userid} seems to be not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28184234/