android - 面子书 ://profile/{userid} seems to be not working

标签 android facebook android-intent android-facebook

我尝试使用特定页面启动 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/

相关文章:

android - 如何识别设备 token 是用于 Android 还是 iOS?

Android webview - 单行 javascript 注释导致未捕获的 SyntaxError 错误?

html - 自定义 Facebook 发送按钮的文本/外观

Android 图片发送 Intent

android - 在android中设置选项卡的内容

android - Dagger 2 不提供我的类作为单例,为什么?

android - 添加Leanback库时获取DexArchiveMergerException

php facebook 支付订阅

php - Canvas 的 Facebook getLoginUrl

java - 接收 null Parcelable 对象