Skip to content Skip to sidebar Skip to footer

Link From My Android App To A Page In Fb App

I've looked for a while on the internet, but haven't found a solution yet. So my question is : Is it possible to open a facebook page 'x' in the facebook app, from clicking on a li

Solution 1:

Ok so I solved it eventually.

This is the Working Code:

publicstaticIntentgetOpenFacebookIntent(Context context) {

       try {
        context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
        returnnewIntent(Intent.ACTION_VIEW, Uri.parse("fb://page/5676133521"));
       } catch (Exception e) {
        returnnewIntent(Intent.ACTION_VIEW, Uri.parse("https://touch.facebook.com/androiddevs"));
       }
    }
}

to obtain the ID of a page you just go to the page in facebook in your browser, and then replace the 'www' to 'graph'. the firs line you'll see will be the ID of the page.

hope this helps people who have the same problem i had !

Post a Comment for "Link From My Android App To A Page In Fb App"