我尝试启动具有特定页面的facebook应用,它与FB APP的早期版本一起使用,但新版本为25.0.0.19.30。该功能无法正常工作,使用uri.parse(“ fb:// profile / {userid}”)的意图将我带到了内容不可用的页面。
通过特定用户页面启动应用的任何其他方式。
您应该使用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);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句