Open facebook page using facebook app

Hi,

I’m also using crosswalk.
Is there a way to open a facebook link to a page using the facebook app instead the default browser or the inappbrowser?

I tried this:

var ID = 1010101010000;
var full_URL = "https://www.facebook.com/pages/page_name/" + ID;

window.open(full_URL, '_system');             
window.open('fb:' + full_URL);
window.open('fb:' + 'https://www.facebook.com/' + ID);
window.open('https://www.facebook.com/' + ID, '_system');

but nothing worked.
Then I installed the cordova-plugin-inappbrowser plugin and now I succeeded in opening the facebook app from my app by doing: window.open('facebook://' + ID, '_system', 'location=no');
the problem is that it just opens the facebook app and it does not redirect to the actual page with that ID.

Any help?

Thanks

1 Like
window.open("facebook://path")

This always works for me

1 Like

Ok thanks, and do you have the inappbrowser plugin installed too?
What do I have to put in path? Thanks

I tried

window.open("facebook://pages/" + ID);
window.open("facebook://" + full_URL);

but the app crashes.

I also tried:

window.open("facebook://pages/" + ID, '_system');

and now it opens the facebook app, but still it does not redirect to the facebook page I want.

i have same problem… and i found this solution. it’s works…

ok thanks, so in javascript what did you do?

i just install inappbrowser and AppAvailability plugin, then in my controller:

appAvailability.check(
    'com.facebook.katana',
    function(){
        // facebook is installed
        window.open('fb://page/YOUR_PAGE_ID', '_system', 'location=no');
    },
    function(){
        // facebook is not installed,
        // then open play store to download and install facebook
        window.open('market://details?id=com.facebook.katana', '_system', 'location=no');
    }
);
2 Likes

in android it worked like a charm
however, in IOS at first i had a permission problem.


after fixing it, now the facebook app crashes right after it opens

Try this - it should be page and not pages… it worked for me :
window.open(“fb://page/” + ID, ‘_system’, ‘location=no’);

2 Likes

it’s work very good…thanks