'Can't properly load facebook page through android app
I would like to open my facebook page through my android app on click of a button. I am currently using the following code: [ as answered here: Open Facebook page from Android app? ]
public static Intent newFacebookIntent(PackageManager pm, String url) {
Uri uri = Uri.parse(url);
try {
ApplicationInfo applicationInfo = pm.getApplicationInfo("com.facebook.katana", 0);
if (applicationInfo.enabled) {
// https://stackoverflow.com/a/24547437/1048340
uri = Uri.parse("fb://facewebmodal/f?href=" + url);
}
} catch (PackageManager.NameNotFoundException ignored) {
}
return new Intent(Intent.ACTION_VIEW, uri);
}
I am able to load the page too in facebook app but, it just shows 'About' section, photos and recent posts. I cant see cover page or like button there. If I manually open facebook app (not through my android app), and visit my page everything displays fine, but problem comes up when i try to link facebook page with my app. Anyone has idea what am i doing wrong and why cant i see the like button? I've been trying to figure this out since 2 days but no luck! Thanks in advance
Solution 1:[1]
this is 2022, I could open Facebook page using
Uri.parse("fb://page/{enter ID here}")
to get the page ID you can just try to send message to the page using messenger in web and the ID is shown plane in the link.
Solution 2:[2]
Feb 2022, I got it to work using:
Uri.parse("fb://faceweb/f?href=" + url);
By the way, this works for pages and groups.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ghiath |
| Solution 2 | RLopez |

