from my Android app, I would like to open a link to a Facebook profile in the official Facebook app (if the app is installed, of course). For iPhone, there exists the
Answering this in October 2018. The working code is the one using the pageID. I just tested it and it is functional.
public static void openUrl(Context ctx, String url){
Uri uri = Uri.parse(url);
if (url.contains(("facebook"))){
try {
ApplicationInfo applicationInfo = ctx.getPackageManager().getApplicationInfo("com.facebook.katana", 0);
if (applicationInfo.enabled) {
uri = Uri.parse("fb://page/");
openURI(ctx, uri);
return;
}
} catch (PackageManager.NameNotFoundException ignored) {
openURI(ctx, uri);
return;
}
}