fb://profile/{userid} 似乎不起作用
fb://profile/{userid} seems to be not working
我尝试使用特定页面启动 facebook 应用程序,它适用于早期版本的 FB 应用程序,但适用于新版本 25.0.0.19.30。此功能不起作用,uri.parse("fb://profile/{userid}") 的意图将我带到内容不可用页面。
- 是否是来自 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);
我尝试使用特定页面启动 facebook 应用程序,它适用于早期版本的 FB 应用程序,但适用于新版本 25.0.0.19.30。此功能不起作用,uri.parse("fb://profile/{userid}") 的意图将我带到内容不可用页面。
- 是否是来自 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);