问题
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