I'm struggling linking to a Facebook profile page when the Facebook app is installed. It says that the page is not available. When the facebook app is not installed (opening with browser), everything works fine. Any ideas?
public static Intent getFBIntent(Context context, String facebookId) {
try {
// Check if FB app is even installed
context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
String facebookScheme = "fb://profile/" + facebookId; //also tried with /page
Log.d("FB_LINK", facebookScheme);
return new Intent(Intent.ACTION_VIEW, Uri.parse(facebookScheme));
}
catch(Exception e) {
// Cache and Open a url in browser
String facebookProfileUri = "https://www.facebook.com/" + facebookId;
return new Intent(Intent.ACTION_VIEW, Uri.parse(facebookProfileUri));
}
}