fb://profile/{userid} seems to be not working

天大地大妈咪最大 提交于 2019-12-23 08:48:29

问题


I try to launch facebook app with specific page , it was working with earlier version of FB APP but with new version that is 25.0.0.19.30 . This functionality is not working , the intent with uri.parse("fb://profile/{userid}") takes me to content not available page .

  • Is it an security update from facebook.

any other way to launch the app with particular user page.


回答1:


You should use fb://page/{id}

Learned it from here: http://binwaheed.blogspot.com.ar/2014/06/android-open-facebook-official-app-from.html

In case you need to fall back to the browser you should implement something like this:

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);


来源:https://stackoverflow.com/questions/28184234/fb-profile-userid-seems-to-be-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!